Adding simple locale parser and parsing result. Ref #14

This commit is contained in:
Victor Dubiniuk 2013-11-14 03:21:27 +03:00
parent 365b0e6357
commit c2dbf80d0f
2 changed files with 66 additions and 0 deletions

57
js/locale.js Normal file
View File

@ -0,0 +1,57 @@
t('documents', "Loading");
t('documents', "Unknown Author");
t('documents', "Loading");
t('documents', "Unknown Author");
t('documents', "Members");
t('documents', "Invite Members");
t('documents', 'Open');
t('documents', 'Save');
t('documents', "Paragraph...");
t('documents', 'Format');
t('documents', 'Close');
t('documents', "Insert Image");
t('documents', "Default Style");
t('documents', 'Undo');
t('documents', 'Redo');
t('documents', "Paragraph Styles");
t('documents', "Clone this Style");
t('documents', "New Name:");
t('documents', "Create");
t('documents', "Clone");
t('documents', "Delete");
t('documents', "OK");
t('documents', "Cancel");
t('documents', 'Annotate');
t('documents', "Font Effects");
t('documents', "Alignment");
t('documents', 'Bold');
t('documents', 'Italic');
t('documents', 'Underline');
t('documents', 'Strikethrough');
t('documents', 'Size');
t('documents', 'Align Left');
t('documents', 'Center');
t('documents', 'Align Right');
t('documents', 'Justify');
t('documents', 'Decrease Indent');
t('documents', 'Increase Indent');
t('documents', "Style");
t('documents', "Bold");
t('documents', "Italic");
t('documents', "Underline");
t('documents', "Font");
t('documents', "Family");
t('documents', "Size");
t('documents', "Color");
t('documents', "Text");
t('documents', "Background");
t('documents', "Options");
t('documents', "Left");
t('documents', "Center");
t('documents', "Right");
t('documents', "Justified");
t('documents', "Spacing");
t('documents', "Top");
t('documents', "Left");
t('documents', "Right");
t('documents', "Bottom");

9
src/locale.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
#extracts strings for translation
JS_PATH=../js/
WEBODF_PATH=../js/3rdparty/webodf/
grep -ohEr "tr\([\"|'][^\"|']*[\"|']\)" ${WEBODF_PATH} | sed -e "s/^tr(/t('documents',\ /" -e "s/\$/;/" > ${JS_PATH}locale.js
grep -ohEr "text-i18n=[\"|'][^\"|']*[\"|']" ${WEBODF_PATH} | sed -e "s/^text-i18n=/t('documents',\ /" -e "s/\$/);/" >> ${JS_PATH}locale.js