paul@1005 | 1 | #!/bin/sh |
paul@1005 | 2 | |
paul@1008 | 3 | # Obtain messages from the Python files. |
paul@1008 | 4 | |
paul@1008 | 5 | find imiptools imipweb -type f -name '*.py' \ |
paul@1008 | 6 | | xargs xgettext -d imip-agent --sort-by-file \ |
paul@1008 | 7 | --copyright-holder="Paul Boddie <paul@boddie.org.uk>" \ |
paul@1008 | 8 | --package-name="imip-agent" --package-version=`hg id | cut -d ' ' -f 1` |
paul@1008 | 9 | |
paul@1008 | 10 | # Set the default charset. |
paul@1005 | 11 | |
paul@1118 | 12 | sed "s/CHARSET/UTF-8/" imip-agent.po \ |
paul@1005 | 13 | > imip-agent.pot |
paul@1005 | 14 | |
paul@1008 | 15 | # Remove the original file. |
paul@1008 | 16 | |
paul@1008 | 17 | rm imip-agent.po |
paul@1008 | 18 | |
paul@1008 | 19 | # Merge messages with the existing translations. |
paul@1008 | 20 | |
paul@1005 | 21 | for FILENAME in messages/*.po ; do |
paul@1005 | 22 | msgmerge --update "$FILENAME" imip-agent.pot |
paul@1005 | 23 | done |