Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a tool to diff/merge/sort localizable strings files?

Localizable strings file which are used for Apple/iPhone apps localization have the following format:

/* COMMENT */
"KEY" = "VALUE"

Note that KEY is unique in a given strings file.
COMMENT is optional however it can help the translator with some additional info.

Example:

/* Menu item to make the current document plain text */
"Make Plain Text" = "Make Plain Text";
/* Menu item to make the current document rich text */
"Make Rich Text" = "Make Rich Text";

I would like to diff/merge two strings files and optionally sort that kind of files. It would be great if the comments would be kept while doing these operations.

The format is quite simple and I could write let's say a python script to do that, but if somebody has already done that, I prefer not reinventing the wheel ;)

Do you know a tool that can manipulate strings file?

like image 285
Jean Regisser Avatar asked Nov 06 '09 17:11

Jean Regisser


3 Answers

I was desperate to find a decent way to manages Localized.strings during development, when there are new strings added to the code and you don't want to manually manage all the files.

I found Localization Manager that does this quite well. It has a nonexistent documentation, but comes with a separate program for the translators. It imports your strings, keeps track of changes and exports the needed Localization.strings files back to your project.

Up till now it seems to be freeware.

like image 176
chaos0815 Avatar answered Sep 30 '22 17:09

chaos0815


Like I said in this post, I recently found a free app called Localizable Strings Merge on the Mac App Store. It does exactly what you ask, even the sorting/beautification. And it is free. Hope it helps.

like image 36
Dev Avatar answered Sep 30 '22 16:09

Dev


I found this tool from the Three20 project:

http://github.com/facebook/three20/blob/master/diffstrings.py

It answers my initial need in different way of what I had imagined:
it can diff between the main locale and the other locales to see what needs translating in each other locale. And then merge back the translated strings.

Note that it outputs xml files to give to the translators.

like image 36
Jean Regisser Avatar answered Sep 30 '22 15:09

Jean Regisser