Seems like this set of scripts works for the tests...

pull/14/head
Tim Su 16 years ago
parent 91e44b668b
commit fd09e395a7

@ -36,8 +36,8 @@ if [ ! -e /usr/bin/gettext ]; then
fi fi
# Set the languages here (po -> name of .po file. res -> name of res folder) # Set the languages here (po -> name of .po file. res -> name of res folder)
po_lang=( "ca" "cs" ) # "de" "es" "fr" "id" "it" "ja" "ko" "nb" "nl" "pl" "pt" "ru" "sv" "tr" "zh_CN" "zh_TW") po_lang=( "ca" ) #"cs" ) # "de" "es" "fr" "id" "it" "ja" "ko" "nb" "nl" "pl" "pt" "ru" "sv" "tr" "zh_CN" "zh_TW")
res_lang=("ca" "cs" ) # "de" "es" "fr" "id" "it" "ja" "ko" "nb" "nl" "pl" "pt" "ru" "sv" "tr" "zh-rCN" "zh-rTW") res_lang=("ca" ) #"cs" ) # "de" "es" "fr" "id" "it" "ja" "ko" "nb" "nl" "pl" "pt" "ru" "sv" "tr" "zh-rCN" "zh-rTW")
#Change the dirs where the files are located. #Change the dirs where the files are located.
launchpad_po_files_dir="translations" launchpad_po_files_dir="translations"
@ -51,6 +51,7 @@ xml2po="`dirname $0`/xml2po.py"
function import_po2xml function import_po2xml
{ {
for resource_file in $android_xml_filenames; do for resource_file in $android_xml_filenames; do
echo "Importing .xml from .pot: $resource_file"
for (( i=0 ; i<${#po_lang[*]} ; i=i+1 )); do for (( i=0 ; i<${#po_lang[*]} ; i=i+1 )); do
echo " Importing .xml from .po for "${resource_file}-${po_lang[i]}"" echo " Importing .xml from .po for "${resource_file}-${po_lang[i]}""
mkdir -p "${android_xml_files_res_dir}"-"${res_lang[i]}" mkdir -p "${android_xml_files_res_dir}"-"${res_lang[i]}"
@ -70,19 +71,11 @@ function export_xml2po
"${android_xml_files_res_dir}"/"${resource_file}".xml "${android_xml_files_res_dir}"/"${resource_file}".xml
for (( i=0 ; i<${#po_lang[*]} ; i=i+1 )); do for (( i=0 ; i<${#po_lang[*]} ; i=i+1 )); do
if [ -e "${launchpad_po_files_dir}"/"${resource_file}"-"${po_lang[i]}".po ] ; then echo " Exporting .xml to updated .po for "${resource_file}-${po_lang[i]}
echo "Exporting .xml to updated .po for "${po_lang[i]}""
if [ -e "${android_xml_files_res_dir}"-"${res_lang[i]}"/"${resource_file}".xml ] ; then
${xml2po} -a \ ${xml2po} -a \
-r "${android_xml_files_res_dir}"-"${res_lang[i]}"/"${resource_file}".xml \ -r "${android_xml_files_res_dir}"-"${res_lang[i]}"/"${resource_file}".xml \
-u "${launchpad_po_files_dir}"/"${resource_file}"-"${po_lang[i]}".po \ "${android_xml_files_res_dir}"/"${resource_file}".xml > \
"${android_xml_files_res_dir}"/"${resource_file}".xml "${launchpad_po_files_dir}"/"${resource_file}"-"${po_lang[i]}".po
else
${xml2po} -a \
-u "${launchpad_po_files_dir}"/"${resource_file}"-"${po_lang[i]}".po \
"${android_xml_files_res_dir}"/"${resource_file}".xml
fi
fi
done done
done done

@ -521,6 +521,7 @@ def processElementTag(node, replacements, restart = 0):
if not translation: if not translation:
translation = outtxt.decode('utf-8') translation = outtxt.decode('utf-8')
if worth and mark_untranslated: node.setLang('C') if worth and mark_untranslated: node.setLang('C')
else:
translation = escapeXmlString(translation) translation = escapeXmlString(translation)
if restart or worth: if restart or worth:

Loading…
Cancel
Save