summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2012-05-02 19:13:48 -0400
committerjvoisin2012-05-02 19:13:48 -0400
commit1e26c0fe56a7e354f0649792de096dfeada8a1c5 (patch)
treef96f97dcd68027b64b6414a826ee01da1d8ed207
parent32d8e6d083e3c54ee35098f678509ecff7243f35 (diff)
Improve i18n
-rw-r--r--MANIFEST.in2
-rw-r--r--po/POTFILES.in1
-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.py25
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 @@
1include README FORMATS LICENSE mat-cli mat-gui 1include README FORMATS LICENSE mat-cli mat-gui
2recursive-include locale *.mo
3recursive-include mat *.py 2recursive-include mat *.py
4recursive-include test *.py clean.* dirty.* 3recursive-include test *.py clean.* dirty.*
4recursive-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
diff --git a/setup.py b/setup.py
index ff9cd50..ec2c1cb 100755..100644
--- a/setup.py
+++ b/setup.py
@@ -1,11 +1,9 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2 2
3import os 3import os
4import sys
5import glob
6import subprocess
7 4
8from distutils.core import setup 5from distutils.core import setup, Command
6from DistUtilsExtra.command import *
9 7
10from lib import mat 8from lib import mat
11 9
@@ -15,17 +13,6 @@ from lib import mat
15if os.path.exists('MANIFEST'): 13if os.path.exists('MANIFEST'):
16 os.remove('MANIFEST') 14 os.remove('MANIFEST')
17 15
18
19def 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
29setup( 16setup(
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)