summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2012-01-12 19:39:19 +0100
committerjvoisin2012-01-12 19:39:19 +0100
commit7ac16efeee256947a60b235b73df2871a5cf64a4 (patch)
tree6cc36731a28a701bb6c51ed01a072ca1f9e21b07
parent781d459540c7cb93929aff1005b72ae091720860 (diff)
parent9bad7d4ac4916b4ffeb528dea8ee4f1959f2f7fd (diff)
Merge branch 'master' of ssh://git-rw.torproject.org/user/jvoisin/mat
-rw-r--r--TODO3
-rw-r--r--locale/fr/LC_MESSAGES/gui.po180
-rw-r--r--locale/fr_FR/LC_MESSAGES/mat-gui.po177
-rwxr-xr-xmat-gui31
-rwxr-xr-xsetup.py21
5 files changed, 218 insertions, 194 deletions
diff --git a/TODO b/TODO
index 6e8cbea..5ccf195 100644
--- a/TODO
+++ b/TODO
@@ -16,6 +16,3 @@ FORMATS:
16 16
17MISC: 17MISC:
18 - a nautilus extension (right-clic -> clean with MAT) 18 - a nautilus extension (right-clic -> clean with MAT)
19
20SETUP:
21 - handle l10n files
diff --git a/locale/fr/LC_MESSAGES/gui.po b/locale/fr/LC_MESSAGES/gui.po
deleted file mode 100644
index 2d5de00..0000000
--- a/locale/fr/LC_MESSAGES/gui.po
+++ /dev/null
@@ -1,180 +0,0 @@
1# Copyright (C) 2011 julien (jvoisin) voisin
2# This file is distributed under the same license as the whole package.
3# julien (jvoisin) voisin <julien.voisin@dustri.org>, 2011
4#
5#, fuzzy
6msgid ""
7msgstr ""
8"Project-Id-Version: PACKAGE VERSION\n"
9"Report-Msgid-Bugs-To: julien (jvoisin) voisin <julien.voisin@dustri.org>\n"
10"POT-Creation-Date: 2011-08-22 19:52+0200\n"
11"PO-Revision-Date: 2011-08-22:GTM+2\n"
12"Last-Translator: julien (jvoisin) voisin <julien.voisin@dustri.org>\n"
13"Language-Team: French <julien.voisin@dustri.org> \n"
14"Language: Francais\n"
15"MIME-Version: 1.0\n"
16"Content-Type: text/plain; charset=utf-8\n"
17"Content-Transfer-Encoding: 8bit\n"
18
19#: mat-gui:83 mat-gui:459 mat-gui:476 mat-gui:493
20msgid "Ready"
21msgstr "Prêt"
22
23#: mat-gui:95
24msgid "Add"
25msgstr "Ajouter"
26
27#: mat-gui:97 mat-gui:179
28msgid "Add files"
29msgstr "Ajouter fichiers"
30
31#: mat-gui:101 mat-gui:199 mat-gui:453
32msgid "Clean (lossless)"
33msgstr "Nettoyage (sans pertes)"
34
35#: mat-gui:103
36msgid "Clean selected files without data loss"
37msgstr "Nettoie sans pertes possibles de données"
38
39#: mat-gui:107 mat-gui:210 mat-gui:451 mat-gui:469 mat-gui:486 mat-gui:491
40msgid "Clean (strict)"
41msgstr "Nettoyage (strict)"
42
43#: mat-gui:109
44msgid "Clean selected files with possible data loss, but clean more efficiently"
45msgstr "Nettoie de manière sure avec pertes possibles d'informations"
46
47#: mat-gui:114 mat-gui:221
48msgid "Check"
49msgstr "Vérification"
50
51#: mat-gui:116
52msgid "Check selected files for harmful meta"
53msgstr "Vérifie l'état des fichiers"
54
55#: mat-gui:120 mat-gui:181
56msgid "Quit"
57msgstr "Quitter"
58
59#: mat-gui:132 mat-gui:315
60msgid "Filename"
61msgstr "Nom"
62
63#: mat-gui:132 mat-gui:317
64msgid "Mimetype"
65msgstr "Type mime"
66
67#: mat-gui:132
68msgid "State"
69msgstr "État"
70
71#: mat-gui:133
72msgid "Cleaned file"
73msgstr "Fichier nettoyé"
74
75#: mat-gui:178
76msgid "Files"
77msgstr "Fichiers"
78
79#: mat-gui:184
80msgid "Edit"
81msgstr "Edition"
82
83#: mat-gui:185
84msgid "Clear the filelist"
85msgstr "Vide la liste de fichiers"
86
87#: mat-gui:188 mat-gui:386
88msgid "Preferences"
89msgstr "Préférences"
90
91#: mat-gui:191
92msgid "Process"
93msgstr "Traiter"
94
95#: mat-gui:226
96msgid "Help"
97msgstr "Aide"
98
99#: mat-gui:227 mat-gui:345
100msgid "Supported formats"
101msgstr "Formats supportés"
102
103#: mat-gui:229
104msgid "About"
105msgstr "A propos"
106
107#: mat-gui:238
108msgid "Choose files"
109msgstr "Selection de fichiers"
110
111#: mat-gui:245
112msgid "All files"
113msgstr "Tous"
114
115#: mat-gui:252
116msgid "Supported files"
117msgstr "Supportés"
118
119#: mat-gui:290
120msgid "unknow"
121msgstr "inconnu"
122
123#: mat-gui:301
124msgid "Not-supported"
125msgstr "non-supporté"
126
127#: mat-gui:332
128msgid "This software was coded during the GSoC 2011"
129msgstr "Ce logiciel a été forgé lors du GSoC 2011"
130
131#: mat-gui:334
132msgid "Website"
133msgstr "Site internet"
134
135#: mat-gui:397
136msgid "Force Clean"
137msgstr "Nettoyage forcé"
138
139#: mat-gui:400
140msgid "Do not check if already clean before cleaning"
141msgstr "Ne pas vérifier l'état avant de traiter"
142
143#: mat-gui:404
144msgid "Backup"
145msgstr "Copie de sauvegarde"
146
147#: mat-gui:407
148msgid "Keep a backup copy"
149msgstr "Garde une copie de sauvegarde"
150
151#: mat-gui:410
152msgid "Add unsupported file to archives"
153msgstr "Ajouter les formats non-supportés aux archives traités"
154
155#: mat-gui:414
156msgid "Add non-supported (and so non-anonymised) file to output archive"
157msgstr ""
158
159#: mat-gui:450
160#, python-format
161msgid "Checking %s..."
162msgstr "Vérification de %s ..."
163
164#: mat-gui:455
165msgid "dirty"
166msgstr "compromettant"
167
168#: mat-gui:468 mat-gui:485
169#, python-format
170msgid "Cleaning %s..."
171msgstr "Nettoyage de %s..."
172
173#: mat-gui:474
174msgid "Clean(lossless)"
175msgstr "Nettoyage (sans pertes)"
176
177#: mat-gui:484
178#, python-format
179msgid "Cleaning (strict) %s"
180msgstr "Nettoyage (strict) %s"
diff --git a/locale/fr_FR/LC_MESSAGES/mat-gui.po b/locale/fr_FR/LC_MESSAGES/mat-gui.po
new file mode 100644
index 0000000..9a7ea11
--- /dev/null
+++ b/locale/fr_FR/LC_MESSAGES/mat-gui.po
@@ -0,0 +1,177 @@
1# Metadata Anonymisation Toolkit
2# Copyright (C) 2011 Julien (jvoisin) Voisin <pouicpouicpouic@gmail.com>"
3# This file is distributed under the same license as the mat package.
4# Julien (jvoisin) Voisin <pouicpouicpouic@gmail.com>\n"
5#
6#, fuzzy
7msgid ""
8msgstr ""
9"Project-Id-Version: fr\n"
10"Report-Msgid-Bugs-To: Julien (jvoisin) Voisin <pouicpouicpouic@gmail.com>\n"
11"POT-Creation-Date: 2012-01-07 00:09+0100\n"
12"PO-Revision-Date: 2012-01-07 00:09+0100\n"
13"Last-Translator: Julien (jvoisin) Voisin <pouicpouicpouic@gmail.com>\n"
14"Language-Team: Julien (jvoisin) Voisin <pouicpouicpouic@gmail.com>\n"
15"Language: fr\n"
16"MIME-Version: 1.0\n"
17"Content-Type: text/plain; charset=UTF-8\n"
18"Content-Transfer-Encoding: 8bit\n"
19
20#: mat-gui:88 mat-gui:504 mat-gui:523 mat-gui:542
21msgid "Ready"
22msgstr "Prêt"
23
24#: mat-gui:100
25msgid "Add"
26msgstr "Ajouter"
27
28#: mat-gui:102 mat-gui:186
29msgid "Add files"
30msgstr "Ajouter fichiers"
31
32#: mat-gui:106 mat-gui:206 mat-gui:498 mat-gui:519
33msgid "Clean (lossless)"
34msgstr "Nettoyer (sans pertes)"
35
36#: mat-gui:108
37msgid "Clean selected files without possible data loss"
38msgstr "Nettoie les fichiers selectionnés sans pertes possible de données"
39
40#: mat-gui:113 mat-gui:217 mat-gui:496 mat-gui:514 mat-gui:533 mat-gui:538
41msgid "Clean (strict)"
42msgstr "Nettoyer (strict)"
43
44#: mat-gui:116
45msgid "Clean selected files with possible data loss, but clean more efficiently"
46msgstr "Nettoie les fichiers selectionnés de manière stricte, mais des pertes de données sont possibles"
47
48#: mat-gui:121 mat-gui:228
49msgid "Check"
50msgstr "Vérifier"
51
52#: mat-gui:123
53msgid "Check selected files for harmful meta"
54msgstr "Vérifie si les fichiers selectionnés comportent des metadatas compromettantes"
55
56#: mat-gui:127 mat-gui:188
57msgid "Quit"
58msgstr "Quitter"
59
60#: mat-gui:139 mat-gui:331
61msgid "Filename"
62msgstr "Nom"
63
64#: mat-gui:139 mat-gui:333
65msgid "Mimetype"
66msgstr "Type Mime"
67
68#: mat-gui:139
69msgid "State"
70msgstr "État"
71
72#: mat-gui:140
73msgid "Cleaned file"
74msgstr "Fichier nettoyé"
75
76#: mat-gui:185
77msgid "Files"
78msgstr "Fichiers"
79
80#: mat-gui:191
81msgid "Edit"
82msgstr "Edition"
83
84#: mat-gui:192
85msgid "Clear the filelist"
86msgstr "Vider la liste de fichiers"
87
88#: mat-gui:195 mat-gui:403
89msgid "Preferences"
90msgstr "Préférences"
91
92#: mat-gui:198
93msgid "Process"
94msgstr "Traiter"
95
96#: mat-gui:232
97msgid "Help"
98msgstr "Aide"
99
100#: mat-gui:233 mat-gui:361
101msgid "Supported formats"
102msgstr "Formats supportés"
103
104#: mat-gui:235
105msgid "About"
106msgstr "À propos"
107
108#: mat-gui:244
109msgid "Choose files"
110msgstr "Choisir fichiers"
111
112#: mat-gui:251
113msgid "All files"
114msgstr "Tout les fichiers"
115
116#: mat-gui:258
117msgid "Supported files"
118msgstr "Fichiers supportés"
119
120#: mat-gui:301
121msgid "unknow"
122msgstr "inconnu"
123
124#: mat-gui:311
125msgid "Not-supported"
126msgstr "Non-supporté"
127
128#: mat-gui:348
129msgid "This software was coded during the GSoC 2011"
130msgstr "Ce logiciel fût forgé lors du GSoC 2011"
131
132#: mat-gui:350
133msgid "Website"
134msgstr "Site internet"
135
136#: mat-gui:414
137msgid "Force Clean"
138msgstr "Forcer le nettoyage"
139
140#: mat-gui:417
141msgid "Do not check if already clean before cleaning"
142msgstr "Ne pas vérifier si un fichier est propre avant le nettoyage"
143
144#: mat-gui:421
145msgid "Backup"
146msgstr "Sauvegarde"
147
148#: mat-gui:424
149msgid "Keep a backup copy"
150msgstr "Conserve une copie de sauvegarde"
151
152#: mat-gui:427
153msgid "Add unsupported file to archives"
154msgstr "Ajoute les types de fichiers non-supportés aux archives"
155
156#: mat-gui:431
157msgid "Add non-supported (and so non-anonymised) file to output archive"
158msgstr "Ajoute les types de fichiers non supportés (et donc, non-traités) aux archives produites"
159
160#: mat-gui:495
161#, python-format
162msgid "Checking %s..."
163msgstr "Vérifie %s..."
164
165#: mat-gui:500
166msgid "dirty"
167msgstr "compromettant"
168
169#: mat-gui:513 mat-gui:532
170#, python-format
171msgid "Cleaning %s..."
172msgstr "Nettoie %s..."
173
174#: mat-gui:531
175#, python-format
176msgid "Cleaning (strict) %s"
177msgstr "Nettoie de manière stricte %s..."
diff --git a/mat-gui b/mat-gui
index 380e4d8..0c047f7 100755
--- a/mat-gui
+++ b/mat-gui
@@ -262,11 +262,11 @@ data loss, but clean more efficiently'))
262 262
263 if response is 0: # gtk.STOCK_OK 263 if response is 0: # gtk.STOCK_OK
264 filenames = chooser.get_filenames() 264 filenames = chooser.get_filenames()
265 task = self.__populate(filenames) 265 task = self.populate(filenames)
266 gobject.idle_add(task.next) # asynchrone processing 266 gobject.idle_add(task.next) # asynchrone processing
267 chooser.destroy() 267 chooser.destroy()
268 268
269 def __populate(self, filenames): 269 def populate(self, filenames):
270 ''' 270 '''
271 Append selected files by add_file to the self.liststore 271 Append selected files by add_file to the self.liststore
272 ''' 272 '''
@@ -461,7 +461,7 @@ non-anonymised) file to output archive'))
461 ''' 461 '''
462 urls = selection.data.strip('\r\n\x00') # strip stupid characters 462 urls = selection.data.strip('\r\n\x00') # strip stupid characters
463 cleaned_urls = map(self.__clean_draged_file_path, urls.split('\n')) 463 cleaned_urls = map(self.__clean_draged_file_path, urls.split('\n'))
464 task = self.__populate(cleaned_urls) 464 task = self.populate(cleaned_urls)
465 gobject.idle_add(task.next) # asynchrone processing 465 gobject.idle_add(task.next) # asynchrone processing
466 466
467 def __clean_draged_file_path(self, url): 467 def __clean_draged_file_path(self, url):
@@ -676,11 +676,26 @@ class TreeViewTooltips(object):
676 name = model[path][0] 676 name = model[path][0]
677 return name.file.filename 677 return name.file.filename
678 678
679
680def translate():
681 ''''
682 Handle L10N of mat-gui
683 '''
684 # get system's language
685 current_lang, _ = locale.getdefaultlocale()
686 if current_lang:
687 langs = [current_lang]
688
689 # get the $LANG environnement's variable
690 language = os.environ.get('LANG', None)
691 if language:
692 langs += language.split(':')
693
694 return gettext.translation('mat-gui', 'locale', langs, fallback=True).ugettext
695
696
679if __name__ == '__main__': 697if __name__ == '__main__':
680 #Translations 698 _ = translate()
681 t = gettext.translation('gui', 'locale', fallback=True)
682 _ = t.ugettext
683 t.install()
684 699
685 #Main 700 #Main
686 gui = GUI() 701 gui = GUI()
@@ -688,7 +703,7 @@ if __name__ == '__main__':
688 #Add files from command line 703 #Add files from command line
689 infiles = [arg for arg in sys.argv[1:] if os.path.exists(arg)] 704 infiles = [arg for arg in sys.argv[1:] if os.path.exists(arg)]
690 if infiles: 705 if infiles:
691 task = gui.__populate(infiles) 706 task = gui.populate(infiles)
692 gobject.idle_add(task.next) 707 gobject.idle_add(task.next)
693 708
694 gtk.main() 709 gtk.main()
diff --git a/setup.py b/setup.py
index bf109e5..7847163 100755
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,9 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2 2
3import os 3import os
4import sys
5import glob
6import subprocess
4 7
5from distutils.core import setup 8from distutils.core import setup
6 9
@@ -12,21 +15,33 @@ from mat import mat
12if os.path.exists('MANIFEST'): 15if os.path.exists('MANIFEST'):
13 os.remove('MANIFEST') 16 os.remove('MANIFEST')
14 17
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
15setup( 29setup(
16 name = 'MAT', 30 name = 'MAT',
17 version = mat.__version__, 31 version = mat.__version__,
18 description = 'Metadata Anonymisation Toolkit', 32 description = 'Metadata Anonymisation Toolkit',
19 long_decription = 'A Metadata Anonymisation Toolkit in Python, using python-hachoir', 33 long_description = 'A Metadata Anonymisation Toolkit in Python, using python-hachoir',
20 author = mat.__author__, 34 author = mat.__author__,
21 author_email = 'julien.voisin@dustri.org', 35 author_email = 'julien.voisin@dustri.org',
22 platforms = 'linux', 36 platforms = 'linux',
23 license = 'GPLv2', 37 license = 'GPLv2',
24 url = 'https://mat.boum.org', 38 url = 'https://mat.boum.org',
25 packages = ['mat', 'mat.hachoir_editor', 'mat.bencode', 'mat.tarfile'], 39 packages = ['mat', 'mat.hachoir_editor', 'mat.bencode', 'mat.tarfile'],
26 scripts = ['mat-cli', 'mat-gui'], 40 scripts = ['mat-cli', 'mat-gui'],
27 data_files = [ 41 data_files = [
28 ( 'share/applications', [ 'mat.desktop' ] ), 42 ( 'share/applications', ['mat.desktop'] ),
29 ( 'share/mat', ['FORMATS'] ), 43 ( 'share/mat', ['FORMATS'] ),
30 ( 'share/doc/mat', ['README', 'TODO'] ), 44 ( 'share/doc/mat', ['README', 'TODO'] ),
45 ( 'share/mat/locale/', [i for i in l10n()] ),
31 ], 46 ],
32) 47)