root/alternc/tags/0.9.7/install/dopo.sh
| Revision 1996, 1.4 kB (checked in by anarcat, 1 year ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | #!/bin/sh |
| 2 | |
| 3 | # AlternC Language file builder |
| 4 | # THIS SCRIPT MUST BE LAUNCHED EACH TIME A MODULE IS ADDED OR REMOVED FROM ALTERNC |
| 5 | # eg: alternc-procmailbuilder, alternc-mailman ... |
| 6 | # $id$ |
| 7 | # |
| 8 | # This script build one "alternc.mo" file per language in /var/alternc/bureau/locales/ |
| 9 | # Each alternc.mo file is build with msgfmt from a alternc.po file. |
| 10 | # Each alternc.po file is build from a serie of .po files located in |
| 11 | # /var/alternc/bureau/locales/<lang>/LC_MESSAGES/*.po |
| 12 | # main.txt is included before all others .po to construct a complete alternc.po file. |
| 13 | |
| 14 | # - Advantages : |
| 15 | # * allow to add or remove standalone modules to an existing AlternC fluently |
| 16 | # * only one textdomain is used in all the sources (no need to change it from module to module) |
| 17 | # - Drawbacks : |
| 18 | # * AlternC now requires gettext package to work properly |
| 19 | # * .mo file must be compiled at each upgrade/install |
| 20 | |
| 21 | dolangs() { |
| 22 | read A |
| 23 | while [ "$A" ] |
| 24 | do |
| 25 | B="$A/LC_MESSAGES" |
| 26 | cd $B |
| 27 | rm -f alternc alternc.mo |
| 28 | |
| 29 | # SARGETAG : msgcat exists only for Sarge, not on Woody. Use po.pl on woody, remove it for sarge. |
| 30 | msgcat --use-first *.po >alternc |
| 31 | # /usr/share/alternc/install/po.pl |
| 32 | |
| 33 | msgfmt alternc -o alternc.mo |
| 34 | read A |
| 35 | done |
| 36 | } |
| 37 | |
| 38 | # Apply the function to each language |
| 39 | find /var/alternc/bureau/locales -maxdepth 1 -mindepth 1 -type d -name "*_*" | dolangs |
| 40 | |
| 41 | # Relance les apache pour qu'ils vident leur cache GetText |
| 42 | invoke-rc.d apache restart |
| 43 | invoke-rc.d apache-ssl restart |
| 44 | |
| 45 | exit 0 |
Note: See TracBrowser for help on using the browser.
