Support for iPhone and CakePHP file structures

By Edouard on December 1, 2011

I just improved the algorithm used to automatically create target project files names depending on the master project file name.

When you create a new file in WebTranslateIt, WebTranslateIt automatically chooses a target file name for you. For instance, if you translate from English to French and Italian, this file name:

en.yml

Will automatically create and keep in sync:

fr.yml

it.yml

WebTranslateIt looks for the en locale code in your file name, and replace it with the locale code of the target locale. If you don’t have a locale code in your file name, WebTranslateIt adds one for you. For instance index.html creates index.fr.html and index.it.html files.

Now, iPhone apps are a different beast. They use a different file structure that includes the full language name instead of locale code. For instance:

English.lproj/Localizable.strings

Until today, you had to manually rename your target files, which was tedious if you had a lot of files or languages. WebTranslateIt now knows how to handle these file names and creates:

French.lproj/Localizable.strings

Italian.lproj/Localizable.strings

WebTranslateIt also support naming CakePHP language files, which use ISO639-2 codes instead of ISO639-1 codes. So this file:

messages/eng.po

Creates:

messages/fre.po

messages/ita.po

I hope you will find this improvement useful. Thank you for using WebTranslateIt.