So I have two language files, english and french. They are in this format:
key=translation
An example in English would be:
ui.title=My Title
And in French:
ui.title=Mon Titre
So I need a script that reads the language files and finds the differences. So say that the English file had keys:
ui.title=Title ui.close=Close
But French only had
ui.title=Mon Titre
After running the script, it should output a file french.changes
containing ui.close=Close
. So this way, I can send the file off to my translators and they can translate it.
When I get it back, I can simply run cat french.changes >> french; sort -o Language_fr_FR.properties
, to merge the changes.
I also need a method of sorting the language files by the key not the whole line.
I looked into diff
but not sure how to use it correctly. I have been using Linux for quite a while but not so up to speed on fancy scripting :)
Thanks for any help!
key=translation
entries on separate lines? Apart from the missing lines, are all entries in the same order? Is the order of the lines of importance or could they be rearranged?ui.close=Close
rather thanui.close=
so that people know what to translate. 2. Yes, they are all on separate lines. 3. The order of the lines in the.changes
file doesn't have to be sorted, but the one after being merged back after translation should be.