root/modules/branches/2.10/mk_i18n_structure

Revision 12696, 1.3 kB (checked in by mbrevda, 2 years ago)

while trying to fix the languagestatus module I ended up refactoring some of the i18n scripts, which in turn rebuilt/updated all the translation files. If I broke anything or otherwise did soemthing stupid, feel free to revert the entire checkin and ill try again

  • Property svn:executable set to *
Line 
1 #!/bin/bash
2 #
3 # Helper utility to create directory structure add a bunch of translation files for the modules
4 #
5 # usage looks like:
6 #
7 # ./mk_i18n_structure ru_RU /tmp/Russian
8 #
9 # where ru_RU would be the language, and /tmp/Russian whould be where all the files
10 # have been placed
11
12 for i in *; do
13   #dont create structure for these modules
14   [ $i = 'fw_ari' ] || [ $i = 'core' ] || [ $i = 'fw_fop' ] && continue
15   echo $i:
16   if [ -d $i ]; then
17     #make i18n directory if it doesnt exists
18     if [ ! -d ${i}/i18n ]; then
19       svn mkdir ${i}/i18n
20     fi
21     #make directry for requested lanugage
22     if [ ! -d ${i}/i18n/$1 ]; then
23       svn mkdir ${i}/i18n/$1/LC_MESSAGES -p
24     fi
25     #copy pot file if it doens already exists
26     if [ ! -e ${i}/i18n/$1/LC_MESSAGES/$i.po ]; then
27       svn cp ${i}/i18n/$i.pot ${i}/i18n/$1/LC_MESSAGES/$i.po
28     #update the file if it dose exists
29     else
30       msgmerge -U ${i}/i18n/$1/LC_MESSAGES/$i.po ${i}/i18n/$i.pot
31     fi
32     if  [ -a ${2}/${i}.mo ] && [ -a ${2}/${i}.po ]; then
33       mv $2/$i.mo $i/i18n/$1/LC_MESSAGES/
34       mv $2/$i.po $i/i18n/$1/LC_MESSAGES/
35       svn add $i/i18n/$1/LC_MESSAGES/$i.mo
36       svn add $i/i18n/$1/LC_MESSAGES/$i.po
37       #now update the .po so that it includes all the latest strings
38       msgmerge -U ${i}/i18n/$1/LC_MESSAGES/$i.po ${i}/i18n/$i.pot
39     fi
40   fi
41 done
42
Note: See TracBrowser for help on using the browser.