I am creating Localizable.strings file programatically. I am downloading the file from server and showing the localization from that file.
But if there is some error in file then my localization don't work. It shows me the keys. If on server I edit the localization file and I added string as
"HELLO_WORLD" = Hello
Here, the key is correct but value is not in correct format. The format should be as
"HELLO_WORLD" = "Hello";
How can I programatically check at runtime if my Localizable.strings file does not contain any error and is valid?
Use plutil from the Terminal:
plutil -lint Localizable.strings
In addition to @Aderstedt's answer:
plutil -lint Localizable.strings does work, but you have to run it for each version of the file. E.g
cd into your project rootcd en.lproj - you can replace this with any localisation you are working with.plutil -lint Localizable.stringsWhen you run step 3, you will either be shown an error, telling you what is wrong with your file. Or you will be told the file is OK
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