Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
move translations to .properties files
Browse files Browse the repository at this point in the history
  • Loading branch information
barrydegraaff committed May 14, 2016
1 parent bf7ae3f commit e6eb5c2
Show file tree
Hide file tree
Showing 24 changed files with 1,315 additions and 2,007 deletions.
52 changes: 0 additions & 52 deletions build.sh
Expand Up @@ -47,59 +47,11 @@ else
exit 0
fi

echo "Create translations"
cat <<EOF > tk_barrydegraaff_zimbra_openpgp/lang.js
/* When adding a language for translation, you may git clone and copy paste from a language in the lang/ folder OR
* download a language from the lang/ folder do your translations and send your copy to lorenzo.milesi@yetopen.it
*
* When editing, please open files in Geany http://www.geany.org/ or use and UTF-8 aware editor
* mode = Unix LF
* encoding = UTF-8
* Additionally you may wish to translate /help/index.html
*
* New languages will be added to the Zimlet after review.
*/
/*
This file is part of the Zimbra OpenPGP Zimlet project.
Copyright (C) 2014-2016 Barry de Graaff
Bugs and feedback: https://github.com/Zimbra-Community/pgp-zimlet/issues
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/
/*
* THIS FILE IS AUTOMATICALLY GENERATED VIA THE BUILD.SH SCRIPT
* *** MANUAL CHANGES IN THIS FILE WILL BE PURGED ***
*/
tk_barrydegraaff_zimbra_openpgp.prototype.lang = function () {
tk_barrydegraaff_zimbra_openpgp.lang = [];
EOF

cat tk_barrydegraaff_zimbra_openpgp/lang/*.js >> tk_barrydegraaff_zimbra_openpgp/lang.js
echo -e "\n\r\n\r}" >> tk_barrydegraaff_zimbra_openpgp/lang.js

echo "Make a copy of the source"
rm -Rf /tmp/tk_barrydegraaff_zimbra_openpgp
mkdir /tmp/tk_barrydegraaff_zimbra_openpgp
cp -r -v tk_barrydegraaff_zimbra_openpgp /tmp/

echo "Remove _dev prefix"
grep -lZr -e "_dev/" "/tmp/tk_barrydegraaff_zimbra_openpgp/" | xargs -0 sed -i "s^_dev/^^g"

echo "Build release zip"
cd /tmp/tk_barrydegraaff_zimbra_openpgp
Expand All @@ -115,9 +67,5 @@ echo 'All done, your release zip should be here: /tmp/tk_barrydegraaff_zimbra_op

exit 0

# choose ^ for seperation of sed command, so ^ cannot be used to search and replace
#The character you put after ’s’ (s being substitute command) determines delimiter you want to use. So you can always specify delimiter that is not contained in your search string to avoid errors, and provide better readability compared to escaping forward slashes. In your case to search for http://www.example.com/oldpage.html and replace it with http://www.example.com/newpage.html you could use ‘_’ as separator:
#sed ’s_http://www.example.com/oldpage.html_http://www.example.com/newpage.html_g’



2 changes: 1 addition & 1 deletion lang-clean.sh
Expand Up @@ -29,6 +29,6 @@ echo string count

for i in {1..100}; do
echo -n $i ' ';
cat tk_barrydegraaff_zimbra_openpgp/tk_barrydegraaff_zimbra_openpgp.js | grep "tk_barrydegraaff_zimbra_openpgp.lang\[tk_barrydegraaff_zimbra_openpgp.settings\['language'\]\]\[$i\]" | wc -l
cat tk_barrydegraaff_zimbra_openpgp/tk_barrydegraaff_zimbra_openpgp.js | grep " OpenPGPZimlet.lang\[$i\]" | wc -l

done
1,015 changes: 104 additions & 911 deletions tk_barrydegraaff_zimbra_openpgp/lang.js

Large diffs are not rendered by default.

90 changes: 0 additions & 90 deletions tk_barrydegraaff_zimbra_openpgp/lang/chinese.js

This file was deleted.

90 changes: 0 additions & 90 deletions tk_barrydegraaff_zimbra_openpgp/lang/dutch.js

This file was deleted.

0 comments on commit e6eb5c2

Please sign in to comment.