root/modules/branches/2.10/merge_i18n.sh

Revision 9956, 1.4 kB (checked in by mickecarlsson, 3 years ago)

Upload two tools I use for language manipulation

  • Property svn:executable set to *
Line 
1 #! /bin/sh
2 # Copyright (c) 2008, 2010 Mikael Carlsson
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # The purpose of this script is to merge all language .po from .pot file
14 # For this script to work you need to so svn co for for branch and for modules and
15 # install this in the same tree so that the script can do all extraction at once.
16 #
17
18     echo "Module $1"
19         for j in $1/i18n/*; do
20             echo "Found language $j"
21             if [ -d ${j}/LC_MESSAGES ]; then
22                 echo "Language $j"
23                 if [ -f ${j}/LC_MESSAGES/$1.po ]; then
24                     echo "Found $1.po for language $j"
25                     # Merge the .po file from the .pot file
26                     msgmerge -N -U ${j}/LC_MESSAGES/$1.po $1/i18n/$1.pot
27                     # Remove the .po~ file
28                     rm ${j}/LC_MESSAGES/$1.po~
29                     # And compile the .po to .mo
30                     msgfmt -v ${j}/LC_MESSAGES/$1.po -o ${j}/LC_MESSAGES/$1.mo
31                 fi
32             fi
33         done
Note: See TracBrowser for help on using the browser.