diff options
| -rw-r--r-- | MANIFEST.in | 2 | ||||
| -rw-r--r-- | po/POTFILES.in | 1 | ||||
| -rw-r--r-- | po/fr.po (renamed from locale/fr_FR/LC_MESSAGES/mat-gui.po) | 0 | ||||
| -rw-r--r-- | po/mat-gui.pot (renamed from locale/gui.pot) | 0 | ||||
| -rw-r--r--[-rwxr-xr-x] | setup.py | 25 |
5 files changed, 11 insertions, 17 deletions
diff --git a/MANIFEST.in b/MANIFEST.in index 99cc0dc..3b7ac13 100644 --- a/MANIFEST.in +++ b/MANIFEST.in | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | include README FORMATS LICENSE mat-cli mat-gui | 1 | include README FORMATS LICENSE mat-cli mat-gui |
| 2 | recursive-include locale *.mo | ||
| 3 | recursive-include mat *.py | 2 | recursive-include mat *.py |
| 4 | recursive-include test *.py clean.* dirty.* | 3 | recursive-include test *.py clean.* dirty.* |
| 4 | recursive-include po * | ||
diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..8dee4d7 --- /dev/null +++ b/po/POTFILES.in | |||
| @@ -0,0 +1 @@ | |||
| mat-gui | |||
diff --git a/locale/fr_FR/LC_MESSAGES/mat-gui.po b/po/fr.po index 9a7ea11..9a7ea11 100644 --- a/locale/fr_FR/LC_MESSAGES/mat-gui.po +++ b/po/fr.po | |||
diff --git a/locale/gui.pot b/po/mat-gui.pot index d8a6ae3..d8a6ae3 100644 --- a/locale/gui.pot +++ b/po/mat-gui.pot | |||
| @@ -1,11 +1,9 @@ | |||
| 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
| 2 | 2 | ||
| 3 | import os | 3 | import os |
| 4 | import sys | ||
| 5 | import glob | ||
| 6 | import subprocess | ||
| 7 | 4 | ||
| 8 | from distutils.core import setup | 5 | from distutils.core import setup, Command |
| 6 | from DistUtilsExtra.command import * | ||
| 9 | 7 | ||
| 10 | from lib import mat | 8 | from lib import mat |
| 11 | 9 | ||
| @@ -15,17 +13,6 @@ from lib import mat | |||
| 15 | if os.path.exists('MANIFEST'): | 13 | if os.path.exists('MANIFEST'): |
| 16 | os.remove('MANIFEST') | 14 | os.remove('MANIFEST') |
| 17 | 15 | ||
| 18 | |||
| 19 | def l10n(): | ||
| 20 | ''' | ||
| 21 | Compile .po files to .mo | ||
| 22 | ''' | ||
| 23 | for language in glob.glob('locale/*/'): | ||
| 24 | fpath = os.path.join(language, 'LC_MESSAGES', 'mat-gui.po') | ||
| 25 | output = fpath[:-2] + 'mo' | ||
| 26 | subprocess.call(['msgfmt', fpath, '-o', output]) | ||
| 27 | yield output | ||
| 28 | |||
| 29 | setup( | 16 | setup( |
| 30 | name = 'MAT', | 17 | name = 'MAT', |
| 31 | version = mat.__version__, | 18 | version = mat.__version__, |
| @@ -42,6 +29,12 @@ setup( | |||
| 42 | ( 'share/applications', ['mat.desktop'] ), | 29 | ( 'share/applications', ['mat.desktop'] ), |
| 43 | ( 'share/mat', ['FORMATS', 'logo.png'] ), | 30 | ( 'share/mat', ['FORMATS', 'logo.png'] ), |
| 44 | ( 'share/doc/mat', ['README', 'TODO'] ), | 31 | ( 'share/doc/mat', ['README', 'TODO'] ), |
| 45 | ( 'share/mat/locale/', [i for i in l10n()] ), | ||
| 46 | ], | 32 | ], |
| 33 | cmdclass = { | ||
| 34 | 'build': build_extra.build_extra, | ||
| 35 | 'build_i18n': build_i18n.build_i18n, | ||
| 36 | 'build_help': build_help.build_help, | ||
| 37 | 'build_icons': build_icons.build_icons, | ||
| 38 | 'clean': clean_i18n.clean_i18n, | ||
| 39 | }, | ||
| 47 | ) | 40 | ) |
