Created
September 29, 2011 15:33
-
-
Save kwk/1251005 to your computer and use it in GitHub Desktop.
Translating JavaScript files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
translate: | |
# | |
#--------------------------------------------------------------------------- | |
# Extracting new language strings and merging them in to one file | |
#--------------------------------------------------------------------------- | |
# | |
cp ${LOCALE_FILE_PATH} ${LOCALE_FILE_PATH_BACKUP} | |
find ${APP_JS_PATH} ${EXT_JS_PATH}/examples/ux -name "*.js" | xgettext -L C -n -o ${LOCALE_FILE_PATH}.new --files=- | |
# Merge translations | |
msgmerge ${LOCALE_FILE_PATH_BACKUP} ${LOCALE_FILE_PATH}.new --output-file=${LOCALE_FILE_PATH}.merged &> /dev/null | |
# Filter out duplicates | |
msguniq ${LOCALE_FILE_PATH}.merged --output-file=${LOCALE_FILE_PATH} &> /dev/null | |
# Manually edit translations | |
poedit ${LOCALE_FILE_PATH}.merged | |
cp -f ${LOCALE_FILE_PATH}.merged ${LOCALE_FILE_PATH} | |
# i18n: Converting PO files to JSON | |
js/gettext/bin/po2json -p ${LOCALE_PATH}/de_DE.po > ${LOCALE_PATH}/de_DE.po.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment