Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localizable.strings corrupted?

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.

like image 724
Paulo Rodrigues Avatar asked Apr 16 '12 20:04

Paulo Rodrigues


People also ask

What are localizable strings?

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.

How do you make a string file localizable?

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.

How do you perform localization in iOS Swift?

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.


2 Answers

If this is your whole file, add a semicolon at the end. Change it to:

"Test locale" = "Test locale";

like image 109
pre Avatar answered Oct 08 '22 17:10

pre


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.

like image 24
lucianoenrico Avatar answered Oct 08 '22 19:10

lucianoenrico