Hi List,
I was getting very annoyed at re-arranging language files by hand once I got new translations, so I sat down and wrote two more scripts for the language directory.
lang/sort_lang.sh: Resorts a language file to make it neat and tidy, with blank lines between groups of alphabetical order strings.
File contents order: HEAD (everything that doesn't match other stuff) chunk translated chunk (matching '^[[:space:]]*$str[[:alnum:]_]*') untranslated chunk (matching '//.*translate.*$' case-insensative)
Now if we want to merge new languages or language strings easily, just dump your translated strings into the file, delete the english strings they replace, and run the sort_lang script on the file. 8-)
lang/check_lang.sh: Checks for duplicate or missing strings in the language files.
From using this, I see that there are few duplicated strings in some
language files that should get fixed in 2.3.1, as well as some language files are missing strings that are in the english file.
----- Original Message ----- From: "Robin Johnson" robbat2@fermi.orbis-terrarum.net
I was getting very annoyed at re-arranging language files by hand once I got new translations, so I sat down and wrote two more scripts for the language directory.
Arg, .sh scripts again... Don't you have a heart for poor Windows users like me...? ;-)
lang/sort_lang.sh: Resorts a language file to make it neat and tidy, with blank lines between groups of alphabetical order strings.
Take a look at the Hindi file: The translated strings are not seperated from the untranslated anymore. Couldn't you modify your script so it skips all strings that are beyond the line
// To translate
? The Hindi translator only translated 75 strings in his first revision, so it would be really annoying to add "//to translate" at the end of each line ;-)
Another small thing: After your optimization, we now have 2 line feeds between "<?php" and the CVS $Id$ tag... In all the other files we only have one... :o)
Alexander
On Sat, 10 Aug 2002, Rabus wrote:
----- Original Message ----- From: "Robin Johnson" robbat2@fermi.orbis-terrarum.net
I was getting very annoyed at re-arranging language files by hand once I got new translations, so I sat down and wrote two more scripts for the language directory.
Arg, .sh scripts again... Don't you have a heart for poor Windows users like me...? ;-)
Umm, if you are a windows user, you can still run the shell scripts quite fine. Just set up CygWin/DJGPP/MinGW, ues the bash shell, and you are all set.
Presently, I do all of my editing at home in a local gvim window, on Win2K, using cygwin and a ported bash shell. The files i'm editing are mounted to my local system via NFS from my server, and that works brilliantly for me.
lang/sort_lang.sh: Resorts a language file to make it neat and tidy, with blank lines between groups of alphabetical order strings.
Take a look at the Hindi file: The translated strings are not seperated from the untranslated anymore. Couldn't you modify your script so it skips all strings that are beyond the line
// To translate
? The Hindi translator only translated 75 strings in his first revision, so it would be really annoying to add "//to translate" at the end of each line ;-)
Would it be ok if it was all strings matching my string pattern after the translate comment like that ?
One further thing for the purpose of matching like this, I am going to go thru all of the files and change the marker for the start of untranslated strings to something else. Probably "/* **** UNTRANSLATED STRINGS **** */" This is because the // To translate is really similar, and I want a distinct marker.
Another small thing: After your optimization, we now have 2 line feeds between "<?php" and the CVS $Id$ tag... In all the other files we only have one... :o)
Sure, fix in progress.