From b7e79595ef9d11e9b784a72f5fcd894443400d21 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Thu, 14 Nov 2013 03:50:02 +0300 Subject: [PATCH] Sort and deduplicate results, ref #14 --- js/locale.js | 97 +++++++++++++++++++++++---------------------------- src/locale.sh | 17 ++++++--- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/js/locale.js b/js/locale.js index 92b61170..998a4e12 100644 --- a/js/locale.js +++ b/js/locale.js @@ -1,57 +1,48 @@ -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', 'Alignment'); t('documents', 'Align Right'); -t('documents', 'Justify'); +t('documents', 'Annotate'); +t('documents', 'Background'); +t('documents', 'Bold'); +t('documents', 'Bottom'); +t('documents', 'Cancel'); +t('documents', 'Center'); +t('documents', 'Clone'); +t('documents', 'Clone this Style'); +t('documents', 'Close'); +t('documents', 'Color'); +t('documents', 'Create'); t('documents', 'Decrease Indent'); +t('documents', 'Default Style'); +t('documents', 'Delete'); +t('documents', 'Family'); +t('documents', 'Font'); +t('documents', 'Font Effects'); +t('documents', 'Format'); 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"); +t('documents', 'Insert Image'); +t('documents', 'Invite Members'); +t('documents', 'Italic'); +t('documents', 'Justified'); +t('documents', 'Justify'); +t('documents', 'Left'); +t('documents', 'Loading'); +t('documents', 'Members'); +t('documents', 'New Name:'); +t('documents', 'OK'); +t('documents', 'Open'); +t('documents', 'Options'); +t('documents', 'Paragraph...'); +t('documents', 'Paragraph Styles'); +t('documents', 'Redo'); +t('documents', 'Right'); +t('documents', 'Save'); +t('documents', 'Size'); +t('documents', 'Spacing'); +t('documents', 'Strikethrough'); +t('documents', 'Style'); +t('documents', 'Text'); +t('documents', 'Top'); +t('documents', 'Underline'); +t('documents', 'Undo'); +t('documents', 'Unknown Author'); diff --git a/src/locale.sh b/src/locale.sh index 3e984017..1a5dbd93 100755 --- a/src/locale.sh +++ b/src/locale.sh @@ -1,9 +1,18 @@ #!/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 +if [ ! -e "README.md" ]; then + echo "Call me in the toplevel dir of OwnCloud Documents." + exit 1 +fi -grep -ohEr "text-i18n=[\"|'][^\"|']*[\"|']" ${WEBODF_PATH} | sed -e "s/^text-i18n=/t('documents',\ /" -e "s/\$/);/" >> ${JS_PATH}locale.js +JS_PATH=js/ +WEBODF_PATH=js/3rdparty/webodf/ +TMP=/tmp/documents-locale.js + +grep -ohEr "tr\([\"|'][^\"|']*[\"|']\)" ${WEBODF_PATH} | sed -e "s/\"/'/g" -e "s/^tr(/t('documents',\ /" -e "s/\$/;/" > ${TMP} + +grep -ohEr "text-i18n=[\"|'][^\"|']*[\"|']" ${WEBODF_PATH} | sed -e "s/\"/'/g" -e "s/^text-i18n=/t('documents',\ /" -e "s/\$/);/" >> ${TMP} + +sort ${TMP} | uniq > ${JS_PATH}locale.js \ No newline at end of file