Check if Localizable.strings file is valid Check if Localizable.strings file is valid swift swift

Check if Localizable.strings file 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

  1. cd into your project root
  2. cd en.lproj - you can replace this with any localisation you are working with.
  3. plutil -lint Localizable.strings

When 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


As mentioned above plutil (property list utility) is a great tool to validate your .plist and .strings files if you edit them manually. You can apply it to all your .strings file by combining it with find. In your project directory run

find . -name *.strings -exec plutil -lint {} \;

or use

find . -path ./DerivedData -prune -o -name *.strings -exec plutil -lint {} \;

if you like to exclude your DerivedData directory (as I usually do).