2004-12-09, 11:05
i've updated the 8-dec-2004 cvs strings.xml files for all languages so they follow the single-line format that's been in use lately for new strings. it should help a lot in readability as well as in text compare operations between the different languages. it didn't take me that long to do (i used macro operations for most of it), so if it's not picked up i won't complain. this:
<strings>
<string>
<id>0</id>
<value>my programs</value>
</string>
<string>
<id>1</id>
<value>my pictures</value>
</string>
now looks like this:
<strings>
<string><id>0</id><value>my programs</value></string>
<string><id>1</id><value>my pictures</value></string>
from the readme.txt in the patch:
below are the unix-style regex patterns i used, in the following order. i used
ultraedit-32 to edit them, but the patterns should work with any regex editor.
the original files are still present and have been renamed to strings.xml.bak.
i verified that english worked, and it also opens correctly in internet explorer 6.
other notes:
- croatian and serbian had a misplaced </strings> tag just after string id 438. fixed.
- german (austria) did not parse correctly after string id 13305 due to differences in
white spaces and formatting. i hand-edited it rather than write a new regex pattern.
- the following languages had only one or two lines that did not parse, so i hand-edited
them as well: italian, japanese, polish
- norwegian had lots of comments, hand-edited all string ids with comments embedded.
- turkish and one other language were already in single-line format, but needed indenting.
/// reformat all strings to a single line each
(<string>)\s*\p\s*(<id>\d*</id>)\s*\p\s*(<value>.*</value>)\s*\p\s*(</string>)\s*\p
\1\2\3\4\p
/// remove all indentations since they aren't uniform
\p\s*<string>
\p<string>
/// re-indent all the strings with a depth of two spaces
\p<string>
\p <string>
/// remove any remaining empty lines-- re-run this until there are no matches found
\p\p
\p
/// remove any remaining lines with nothing but white space-- re-run this until there are no matches found
\p\s*\p
\p
<strings>
<string>
<id>0</id>
<value>my programs</value>
</string>
<string>
<id>1</id>
<value>my pictures</value>
</string>
now looks like this:
<strings>
<string><id>0</id><value>my programs</value></string>
<string><id>1</id><value>my pictures</value></string>
from the readme.txt in the patch:
below are the unix-style regex patterns i used, in the following order. i used
ultraedit-32 to edit them, but the patterns should work with any regex editor.
the original files are still present and have been renamed to strings.xml.bak.
i verified that english worked, and it also opens correctly in internet explorer 6.
other notes:
- croatian and serbian had a misplaced </strings> tag just after string id 438. fixed.
- german (austria) did not parse correctly after string id 13305 due to differences in
white spaces and formatting. i hand-edited it rather than write a new regex pattern.
- the following languages had only one or two lines that did not parse, so i hand-edited
them as well: italian, japanese, polish
- norwegian had lots of comments, hand-edited all string ids with comments embedded.
- turkish and one other language were already in single-line format, but needed indenting.
/// reformat all strings to a single line each
(<string>)\s*\p\s*(<id>\d*</id>)\s*\p\s*(<value>.*</value>)\s*\p\s*(</string>)\s*\p
\1\2\3\4\p
/// remove all indentations since they aren't uniform
\p\s*<string>
\p<string>
/// re-indent all the strings with a depth of two spaces
\p<string>
\p <string>
/// remove any remaining empty lines-- re-run this until there are no matches found
\p\p
\p
/// remove any remaining lines with nothing but white space-- re-run this until there are no matches found
\p\s*\p
\p