How can I check if there are any errors in the file and where I am getting these errors? In the other words, How can I debug Localizable.strings file in Xcode ?
Choose File → New → File ..., select Strings File under Resources, and click Next. Name it Localizable, then click on Create.
string file, select it and on the File Inspector (right menu) select “Localize”. Select your the new language you added and click on “Finish”. If you select the file again you should see something similar to the first image below (be sure to select both the supported languages).
Last modified: 06 October 2021. Internationalization (i18n) refers to the process of extracting strings from source code and presenting them as properties with a set of values. Localization (l10n) is the process of translating values of these properties into target languages.
Unfortunately, Xcode dosesn't show line with error. If you or another developer was changing Localisable.strings recently, probably one of added / changed lines is missing semicolon at end (see answer under this question: Localizable.strings corrupted? ). If file is big and / or error is not easy to see probably lucianoenrico answer will be helpful. I will quote it now:
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 it is a semicolon issue you can also open corrupted file, search for ";" and look for line without highlighted ";" at end. Also look for block comments without closing "*/" and unescaped or incorrect quotation marks (need \"). This last issue is visible because part of string changes color.
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