I'm trying to include the internationalization of my application, and only for testing purposes I added a simple line in the file Localizable.string.
This is my whole file:
"Test locale" = "Test locale"
And when I try run my application I get this error:
Localizable.strings:0: error: validation failed: The data couldn’t be read because it has been corrupted.
I've tried changing the "Text Encoding" to UTF-16 but nothing resolved.
A localized string can have different values depending on the language in which the project is being build. There are two categories of localized strings: the strings included in the installation package's UI, common to every MSI file.
Let us move on to create a string file called 'Localizable' that will hold the text we want to localize. Choose File → New → File ..., select Strings File under Resources, and click Next. Name it Localizable, then click on Create.
Click on iOS->App/Single View App->Next. Name your project and select the language as Swift. Select a desired location and click on Create. To start with Localization, click on your Project Name -> go to Info Tab -> Under Localizations, click on the '+' button.
If this is your whole file, add a semicolon at the end. Change it to:
"Test locale" = "Test locale";
To get more detailed informations you can use the Property List utility from the command line:
plutil -lint <your_strings_file>.strings
the -lint
switch is for checking the syntax. If you have an error you'll get line number and more informations, and in general better directions on how to fix the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With