diff options
author | florent <florent.pigout@gmail.com> | 2011-04-29 11:38:14 (GMT) |
---|---|---|
committer | florent <florent.pigout@gmail.com> | 2011-04-29 11:38:14 (GMT) |
commit | 77513a43221836d09387238b96c1408981311126 (patch) | |
tree | 4d7c4f652c8ca47b0aee8cdd726520e6404eb556 | |
parent | 722bb25b353daf7970533937ccd1d25e196fe5ee (diff) |
add po files
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | atoidejouer/tools/storage.py | 12 | ||||
-rw-r--r-- | atoidejouer/tools/ui.py | 1 | ||||
-rw-r--r-- | atoidejouer/ui/panel.py | 2 | ||||
-rw-r--r-- | locale/fr/LC_MESSAGES/org.laptop.AToiDePocActivity.mo | bin | 373 -> 0 bytes | |||
-rw-r--r-- | locale/fr/activity.linfo | 2 | ||||
-rw-r--r-- | po/AToiDePoc.pot | 19 | ||||
-rw-r--r-- | po/README | 5 | ||||
-rw-r--r-- | po/app.fil | 8 | ||||
-rw-r--r-- | po/atoidejouer_en.po | 363 | ||||
-rw-r--r-- | po/atoidejouer_fr.po | 382 | ||||
-rw-r--r-- | po/fr.po | 19 | ||||
-rw-r--r-- | po/messages.pot | 363 | ||||
-rw-r--r-- | po/mki18n.py | 459 |
14 files changed, 1588 insertions, 48 deletions
@@ -3,3 +3,4 @@ syntax: glob *.swp *.seq *.ogg +locale diff --git a/atoidejouer/tools/storage.py b/atoidejouer/tools/storage.py index 9f780c1..c8db5ac 100644 --- a/atoidejouer/tools/storage.py +++ b/atoidejouer/tools/storage.py @@ -486,22 +486,22 @@ def export_project(activity_, msg_label, media): try: if os.path.exists(os.path.join('/media', media, _tar_name)): # .. - _msg = _('Project \'%s\' already exported to \'%s\'!'\ - % (_name, media)) + _msg = _('Project "%(name)s" already exported to "%(media)s"!'\ + % {"name": _name, "media": media}) else: # .. shutil.copy(os.path.join(_tmp_root, _tar_name), os.path.join('/media', media)) # .. - _msg = _('Project \'%s\' sucessfully exported to \'%s\''\ - % (_name, media)) + _msg = _('Project "%(name)s" sucessfully exported to "%(media)s"'\ + % {"name": _name, "media": media}) except Exception, e: # ERROR logger.error('[storage] export_project - e: %s' % e) # ERROR # .. - _msg = _('Project \'%s\' export to \'%s\' failed!'\ - % (_name, media)) + _msg = _('Project "%(name)s" export to "%(media)s" failed!'\ + % {"name": _name, "media": media}) # remove tmp structure __remove_dir('tmp', parent=None) # tmp message diff --git a/atoidejouer/tools/ui.py b/atoidejouer/tools/ui.py index 9c9ecd4..0b0fa76 100644 --- a/atoidejouer/tools/ui.py +++ b/atoidejouer/tools/ui.py @@ -1,7 +1,6 @@ # python import import logging, os -from gettext import gettext as _ # gtk import import gtk diff --git a/atoidejouer/ui/panel.py b/atoidejouer/ui/panel.py index 2112a4b..b4091f1 100644 --- a/atoidejouer/ui/panel.py +++ b/atoidejouer/ui/panel.py @@ -837,7 +837,7 @@ class PanelGraphics(Panel): _row3.pack_start(self.__get_position_button('x_left_left', 'x', -10, _('Move Left by 10%')), expand=False, fill=True) _row3.pack_start(self.__get_position_button('x_left', 'x', -1, - _('Move Up by 1%')), expand=False, fill=True) + _('Move Left by 1%')), expand=False, fill=True) # prepare middle box _middle_box = gtk.VBox(homogeneous=True, spacing=4) _middle_box.show() diff --git a/locale/fr/LC_MESSAGES/org.laptop.AToiDePocActivity.mo b/locale/fr/LC_MESSAGES/org.laptop.AToiDePocActivity.mo Binary files differdeleted file mode 100644 index cceef50..0000000 --- a/locale/fr/LC_MESSAGES/org.laptop.AToiDePocActivity.mo +++ /dev/null diff --git a/locale/fr/activity.linfo b/locale/fr/activity.linfo deleted file mode 100644 index e0eb2e5..0000000 --- a/locale/fr/activity.linfo +++ /dev/null @@ -1,2 +0,0 @@ -[Activity] -name = AToiDeJouer diff --git a/po/AToiDePoc.pot b/po/AToiDePoc.pot deleted file mode 100644 index f2236e3..0000000 --- a/po/AToiDePoc.pot +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-29 16:47-0600\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" diff --git a/po/README b/po/README new file mode 100644 index 0000000..3d066f5 --- /dev/null +++ b/po/README @@ -0,0 +1,5 @@ +# create pot file +python mki18n.py -p --domain=atoidejouer + +# gen mo files +python mki18n.py -m -e --domain=atoidejouer --moTarget=../locale diff --git a/po/app.fil b/po/app.fil new file mode 100644 index 0000000..f537d15 --- /dev/null +++ b/po/app.fil @@ -0,0 +1,8 @@ +../activity.py +../atoidejouer/tools/storage.py +../atoidejouer/ui/notebook.py +../atoidejouer/ui/panel.py +../atoidejouer/ui/preview.py +../atoidejouer/ui/screens.py +../atoidejouer/ui/timeline.py +../atoidejouer/ui/toolbar.py diff --git a/po/atoidejouer_en.po b/po/atoidejouer_en.po new file mode 100644 index 0000000..0932277 --- /dev/null +++ b/po/atoidejouer_en.po @@ -0,0 +1,363 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-04-29 12:42+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../atoidejouer/tools/storage.py:354 +#, python-format +msgid "" +"%s\n" +"\n" +"[Error] Can not load files!" +msgstr "" + +#: ../atoidejouer/tools/storage.py:373 +#, python-format +msgid "" +"%s\n" +"\n" +"[Error] Can not load keys!" +msgstr "" + +#: ../atoidejouer/tools/storage.py:336 +#, python-format +msgid "" +"%s\n" +"\n" +"[Error] Can not read archive file!" +msgstr "" + +#: ../atoidejouer/tools/storage.py:364 +#, python-format +msgid "" +"%s\n" +"\n" +"[Warning] Following files already exist:\n" +msgstr "" + +#: ../atoidejouer/tools/storage.py:383 +#, python-format +msgid "" +"%s\n" +"\n" +"[Warning] Following sequences already exist:\n" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:415 ../atoidejouer/ui/toolbar.py:421 +msgid "Add Graphic" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:443 ../atoidejouer/ui/toolbar.py:449 +msgid "Add Sound" +msgstr "" + +#: ../atoidejouer/ui/screens.py:772 +msgid "Advanced" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:422 ../atoidejouer/ui/toolbar.py:450 +msgid "Back" +msgstr "" + +#: ../atoidejouer/ui/screens.py:831 +msgid "Choose a File" +msgstr "" + +#: ../atoidejouer/ui/panel.py:498 +msgid "Choose a Sequence Item" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:473 +msgid "Default Screen" +msgstr "" + +#: ../atoidejouer/ui/panel.py:975 +msgid "Duration +10s" +msgstr "" + +#: ../atoidejouer/ui/panel.py:973 +msgid "Duration +1s" +msgstr "" + +#: ../atoidejouer/ui/panel.py:957 +msgid "Duration -10s" +msgstr "" + +#: ../atoidejouer/ui/panel.py:959 +msgid "Duration -1s" +msgstr "" + +#: ../atoidejouer/ui/screens.py:835 +msgid "EXPORT" +msgstr "" + +#: ../atoidejouer/ui/screens.py:767 +msgid "Easy" +msgstr "" + +#: ../atoidejouer/ui/screens.py:845 +#, python-format +msgid "Export to media '%s'" +msgstr "" + +#: ../atoidejouer/ui/screens.py:786 +msgid "FRAME RATE" +msgstr "" + +#: ../atoidejouer/ui/screens.py:798 +msgid "Faster" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:424 ../atoidejouer/ui/toolbar.py:452 +msgid "Frame After" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:423 ../atoidejouer/ui/toolbar.py:451 +msgid "Frame Before" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:472 +msgid "Fullscreen" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:407 +msgid "Graphic" +msgstr "" + +#: ../atoidejouer/ui/screens.py:828 +msgid "IMPORT" +msgstr "" + +#: ../atoidejouer/ui/panel.py:763 +msgid "Image" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:426 ../atoidejouer/ui/toolbar.py:454 +msgid "Import Sequence" +msgstr "" + +#: ../atoidejouer/ui/notebook.py:382 +msgid "Journal" +msgstr "" + +#: ../atoidejouer/ui/panel.py:647 +msgid "Key" +msgstr "" + +#: ../atoidejouer/ui/panel.py:785 +msgid "Layer to Bottom" +msgstr "" + +#: ../atoidejouer/ui/panel.py:802 +msgid "Layer to Top" +msgstr "" + +#: ../atoidejouer/ui/notebook.py:374 +msgid "Library" +msgstr "" + +#: ../atoidejouer/ui/panel.py:1000 +msgid "Loop (On/Off)" +msgstr "" + +#: ../atoidejouer/ui/panel.py:787 +msgid "Lower Layer" +msgstr "" + +#: ../atoidejouer/ui/screens.py:763 +msgid "MODE" +msgstr "" + +#: ../atoidejouer/ui/panel.py:865 +msgid "Move Down by 1%" +msgstr "" + +#: ../atoidejouer/ui/panel.py:868 +msgid "Move Down by 10%" +msgstr "" + +#: ../atoidejouer/ui/panel.py:838 +msgid "Move Left by 10%" +msgstr "" + +#: ../atoidejouer/ui/panel.py:858 +msgid "Move Right by 1%" +msgstr "" + +#: ../atoidejouer/ui/panel.py:860 +msgid "Move Right by 10%" +msgstr "" + +#: ../atoidejouer/ui/panel.py:833 ../atoidejouer/ui/panel.py:840 +msgid "Move Up by 1%" +msgstr "" + +#: ../atoidejouer/ui/panel.py:830 +msgid "Move Up by 10%" +msgstr "" + +#: ../atoidejouer/ui/notebook.py:323 +msgid "Name" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:428 +msgid "New Sequence" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:456 +msgid "New Sound" +msgstr "" + +#: ../atoidejouer/ui/screens.py:790 +msgid "Normal" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:411 ../atoidejouer/ui/toolbar.py:439 +#: ../atoidejouer/ui/toolbar.py:468 +msgid "Pause Story" +msgstr "" + +#: ../atoidejouer/ui/panel.py:617 +msgid "Play After (1 Frames)" +msgstr "" + +#: ../atoidejouer/ui/panel.py:619 +msgid "Play After (10 Frames)" +msgstr "" + +#: ../atoidejouer/ui/panel.py:604 +msgid "Play Before (1 Frames)" +msgstr "" + +#: ../atoidejouer/ui/panel.py:602 +msgid "Play Before (10 Frames)" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:412 ../atoidejouer/ui/toolbar.py:440 +#: ../atoidejouer/ui/toolbar.py:469 +msgid "Play Story" +msgstr "" + +#: ../atoidejouer/ui/panel.py:818 +msgid "Position" +msgstr "" + +#: ../atoidejouer/ui/notebook.py:322 +msgid "Preview" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:413 ../atoidejouer/ui/toolbar.py:441 +#: ../atoidejouer/ui/toolbar.py:470 +msgid "Progress Bar" +msgstr "" + +#: ../atoidejouer/tools/storage.py:489 +#, python-format +msgid "Project \"%(name)s\" already exported to \"%(media)s\"!" +msgstr "" + +#: ../atoidejouer/tools/storage.py:503 +#, python-format +msgid "Project \"%(name)s\" export to \"%(media)s\" failed!" +msgstr "" + +#: ../atoidejouer/tools/storage.py:496 +#, python-format +msgid "Project \"%(name)s\" sucessfully exported to \"%(media)s\"" +msgstr "" + +#: ../atoidejouer/tools/storage.py:335 ../atoidejouer/tools/storage.py:353 +#: ../atoidejouer/tools/storage.py:372 +msgid "Project import failed!" +msgstr "" + +#: ../atoidejouer/tools/storage.py:350 +msgid "Project sucessfully imported" +msgstr "" + +#: ../atoidejouer/ui/panel.py:800 +msgid "Raise Layer" +msgstr "" + +#: ../atoidejouer/ui/panel.py:625 +msgid "Remove" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:427 +msgid "Remove Graphic" +msgstr "" + +#: ../atoidejouer/ui/notebook.py:144 +msgid "Remove Item from Disk" +msgstr "" + +#: ../atoidejouer/ui/panel.py:649 +msgid "Remove Key" +msgstr "" + +#: ../atoidejouer/ui/panel.py:641 ../atoidejouer/ui/toolbar.py:430 +#: ../atoidejouer/ui/toolbar.py:458 +msgid "Remove Sequence" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:455 +msgid "Remove Sound" +msgstr "" + +#: ../atoidejouer/ui/panel.py:992 +msgid "Repeat" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:431 ../atoidejouer/ui/toolbar.py:459 +msgid "Save Sequence" +msgstr "" + +#: ../atoidejouer/ui/panel.py:639 +msgid "Sequence" +msgstr "" + +#: ../atoidejouer/ui/preview.py:48 +msgid "Sequence Graphics" +msgstr "" + +#: ../atoidejouer/ui/preview.py:49 +msgid "Sequence Sounds" +msgstr "" + +#: ../atoidejouer/ui/notebook.py:364 +msgid "Sequences" +msgstr "" + +#: ../atoidejouer/ui/screens.py:795 +msgid "Smooth" +msgstr "" + +#: ../atoidejouer/ui/panel.py:1010 ../atoidejouer/ui/toolbar.py:435 +msgid "Sound" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:414 ../atoidejouer/ui/toolbar.py:442 +#: ../atoidejouer/ui/toolbar.py:471 +msgid "Stop Story" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:463 +msgid "Story" +msgstr "" + +#: ../atoidejouer/ui/panel.py:590 +msgid "Time" +msgstr "" diff --git a/po/atoidejouer_fr.po b/po/atoidejouer_fr.po new file mode 100644 index 0000000..90bebce --- /dev/null +++ b/po/atoidejouer_fr.po @@ -0,0 +1,382 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-04-29 12:42+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../atoidejouer/tools/storage.py:354 +#, python-format +msgid "" +"%s\n" +"\n" +"[Error] Can not load files!" +msgstr "" +"%s\n" +"\n" +"[Erreur] Fichiers non chargés!" + +#: ../atoidejouer/tools/storage.py:373 +#, python-format +msgid "" +"%s\n" +"\n" +"[Error] Can not load keys!" +msgstr "" +"%s\n" +"\n" +"[Erreur] Clefs non chargés!" + +#: ../atoidejouer/tools/storage.py:336 +#, python-format +msgid "" +"%s\n" +"\n" +"[Error] Can not read archive file!" +msgstr "" +"%s\n" +"\n" +"[Erreur] Impossible de lire l'archive!" + +#: ../atoidejouer/tools/storage.py:364 +#, python-format +msgid "" +"%s\n" +"\n" +"[Warning] Following files already exist:\n" +msgstr "" +"%s\n" +"\n" +"[Note] Les fichiers suivants existent déjà:\n" + +#: ../atoidejouer/tools/storage.py:383 +#, python-format +msgid "" +"%s\n" +"\n" +"[Warning] Following sequences already exist:\n" +msgstr "" +"%s\n" +"\n" +"[Note] Les séquences suivantes existent déjà:\n" + +#: ../atoidejouer/ui/toolbar.py:415 ../atoidejouer/ui/toolbar.py:421 +msgid "Add Graphic" +msgstr "Ajouter Image" + +#: ../atoidejouer/ui/toolbar.py:443 ../atoidejouer/ui/toolbar.py:449 +msgid "Add Sound" +msgstr "Ajouter Son" + +#: ../atoidejouer/ui/screens.py:772 +msgid "Advanced" +msgstr "Avancé" + +#: ../atoidejouer/ui/toolbar.py:422 ../atoidejouer/ui/toolbar.py:450 +msgid "Back" +msgstr "Retour" + +#: ../atoidejouer/ui/screens.py:831 +msgid "Choose a File" +msgstr "Choisir un Fichier" + +#: ../atoidejouer/ui/panel.py:498 +msgid "Choose a Sequence Item" +msgstr "Choisir un Elément pour la Séquence" + +#: ../atoidejouer/ui/toolbar.py:473 +msgid "Default Screen" +msgstr "Ecran par Défault" + +#: ../atoidejouer/ui/panel.py:975 +msgid "Duration +10s" +msgstr "Durée +10s" + +#: ../atoidejouer/ui/panel.py:973 +msgid "Duration +1s" +msgstr "Durée +1s" + +#: ../atoidejouer/ui/panel.py:957 +msgid "Duration -10s" +msgstr "Durée -10s" + +#: ../atoidejouer/ui/panel.py:959 +msgid "Duration -1s" +msgstr "Durée -1s" + +#: ../atoidejouer/ui/screens.py:835 +msgid "EXPORT" +msgstr "EXPORTER" + +#: ../atoidejouer/ui/screens.py:767 +msgid "Easy" +msgstr "Facile" + +#: ../atoidejouer/ui/screens.py:845 +#, python-format +msgid "Export to media '%s'" +msgstr "Exporter vers '%s'" + +#: ../atoidejouer/ui/screens.py:786 +msgid "FRAME RATE" +msgstr "FLUIDITE" + +#: ../atoidejouer/ui/screens.py:798 +msgid "Faster" +msgstr "Rapide" + +#: ../atoidejouer/ui/toolbar.py:424 ../atoidejouer/ui/toolbar.py:452 +msgid "Frame After" +msgstr "Avant dans la Séquence" + +#: ../atoidejouer/ui/toolbar.py:423 ../atoidejouer/ui/toolbar.py:451 +msgid "Frame Before" +msgstr "Après dans la Séquence" + +#: ../atoidejouer/ui/toolbar.py:472 +msgid "Fullscreen" +msgstr "Plein Ecran" + +#: ../atoidejouer/ui/toolbar.py:407 +msgid "Graphic" +msgstr "Image" + +#: ../atoidejouer/ui/screens.py:828 +msgid "IMPORT" +msgstr "IMPORTER" + +#: ../atoidejouer/ui/panel.py:763 +msgid "Image" +msgstr "Image" + +#: ../atoidejouer/ui/toolbar.py:426 ../atoidejouer/ui/toolbar.py:454 +msgid "Import Sequence" +msgstr "Ajouter une Séquence" + +#: ../atoidejouer/ui/notebook.py:382 +msgid "Journal" +msgstr "Journal" + +#: ../atoidejouer/ui/panel.py:647 +msgid "Key" +msgstr "Clef" + +#: ../atoidejouer/ui/panel.py:785 +msgid "Layer to Bottom" +msgstr "Calque Dessous" + +#: ../atoidejouer/ui/panel.py:802 +msgid "Layer to Top" +msgstr "Calque Dessus" + +#: ../atoidejouer/ui/notebook.py:374 +msgid "Library" +msgstr "Librairie" + +#: ../atoidejouer/ui/panel.py:1000 +msgid "Loop (On/Off)" +msgstr "En boucle (Oui/Non)" + +#: ../atoidejouer/ui/panel.py:787 +msgid "Lower Layer" +msgstr "Calque derrière" + +#: ../atoidejouer/ui/screens.py:763 +msgid "MODE" +msgstr "DIFFICULTE" + +#: ../atoidejouer/ui/panel.py:865 +msgid "Move Down by 1%" +msgstr "Déplacer vers le bas 1%" + +#: ../atoidejouer/ui/panel.py:868 +msgid "Move Down by 10%" +msgstr "Déplacer vers le bas 10%" + +#: ../atoidejouer/ui/panel.py:838 +msgid "Move Left by 10%" +msgstr "Déplacer vers la gauche +10%" + +#: ../atoidejouer/ui/panel.py:840 +msgid "Move Left by 1%" +msgstr "Déplacer vers la gauche +1%" + +#: ../atoidejouer/ui/panel.py:858 +msgid "Move Right by 1%" +msgstr "Déplacer vers la right +1%" + +#: ../atoidejouer/ui/panel.py:860 +msgid "Move Right by 10%" +msgstr "Déplacer vers la right +10%" + +#: ../atoidejouer/ui/panel.py:833 ../atoidejouer/ui/panel.py:840 +msgid "Move Up by 1%" +msgstr "Déplacer vers le haut +1%" + +#: ../atoidejouer/ui/panel.py:830 +msgid "Move Up by 10%" +msgstr "Déplacer vers le haut +10%" + +#: ../atoidejouer/ui/notebook.py:323 +msgid "Name" +msgstr "Nom" + +#: ../atoidejouer/ui/toolbar.py:428 +msgid "New Sequence" +msgstr "Nouvelle Séquence" + +#: ../atoidejouer/ui/toolbar.py:456 +msgid "New Sound" +msgstr "Nouveau Son" + +#: ../atoidejouer/ui/screens.py:790 +msgid "Normal" +msgstr "Normal" + +#: ../atoidejouer/ui/toolbar.py:411 ../atoidejouer/ui/toolbar.py:439 +#: ../atoidejouer/ui/toolbar.py:468 +msgid "Pause Story" +msgstr "Pause Histoire" + +#: ../atoidejouer/ui/panel.py:617 +msgid "Play After (1 Frames)" +msgstr "Afficher Après +1" + +#: ../atoidejouer/ui/panel.py:619 +msgid "Play After (10 Frames)" +msgstr "Afficher Après +10" + +#: ../atoidejouer/ui/panel.py:604 +msgid "Play Before (1 Frames)" +msgstr "Afficher Avant +1" + +#: ../atoidejouer/ui/panel.py:602 +msgid "Play Before (10 Frames)" +msgstr "Afficher Avant +10" + +#: ../atoidejouer/ui/toolbar.py:412 ../atoidejouer/ui/toolbar.py:440 +#: ../atoidejouer/ui/toolbar.py:469 +msgid "Play Story" +msgstr "Jouer Histoire" + +#: ../atoidejouer/ui/panel.py:818 +msgid "Position" +msgstr "Position" + +#: ../atoidejouer/ui/notebook.py:322 +msgid "Preview" +msgstr "Aperçu" + +#: ../atoidejouer/ui/toolbar.py:413 ../atoidejouer/ui/toolbar.py:441 +#: ../atoidejouer/ui/toolbar.py:470 +msgid "Progress Bar" +msgstr "Barre de Progression" + +#: ../atoidejouer/tools/storage.py:489 +#, python-format +msgid "Project \"%(name)s\" already exported to \"%(media)s\"!" +msgstr "Projet \"%(name)s\" déjà exporté vers \"%(media)s\"!" + +#: ../atoidejouer/tools/storage.py:503 +#, python-format +msgid "Project \"%(name)s\" export to \"%(media)s\" failed!" +msgstr "Export du Projet \"%(name)s\" vers \"%(media)s\" à échoué!" + +#: ../atoidejouer/tools/storage.py:496 +#, python-format +msgid "Project \"%(name)s\" sucessfully exported to \"%(media)s\"" +msgstr "Projet \"%(name)s\" exporté avec succés vers \"%(media)s\"" + +#: ../atoidejouer/tools/storage.py:335 ../atoidejouer/tools/storage.py:353 +#: ../atoidejouer/tools/storage.py:372 +msgid "Project import failed!" +msgstr "Import du projet à échoué" + +#: ../atoidejouer/tools/storage.py:350 +msgid "Project sucessfully imported" +msgstr "Import du projet avec succés" + +#: ../atoidejouer/ui/panel.py:800 +msgid "Raise Layer" +msgstr "Calque devant" + +#: ../atoidejouer/ui/panel.py:625 +msgid "Remove" +msgstr "Retirer" + +#: ../atoidejouer/ui/toolbar.py:427 +msgid "Remove Graphic" +msgstr "Retirer Image" + +#: ../atoidejouer/ui/notebook.py:144 +msgid "Remove Item from Disk" +msgstr "Retirer Image du Disque" + +#: ../atoidejouer/ui/panel.py:649 +msgid "Remove Key" +msgstr "Retirer Clef" + +#: ../atoidejouer/ui/panel.py:641 ../atoidejouer/ui/toolbar.py:430 +#: ../atoidejouer/ui/toolbar.py:458 +msgid "Remove Sequence" +msgstr "Retirer Séquence" + +#: ../atoidejouer/ui/toolbar.py:455 +msgid "Remove Sound" +msgstr "Retirer Son" + +#: ../atoidejouer/ui/panel.py:992 +msgid "Repeat" +msgstr "Répéter" + +#: ../atoidejouer/ui/toolbar.py:431 ../atoidejouer/ui/toolbar.py:459 +msgid "Save Sequence" +msgstr "Sauver la séquence" + +#: ../atoidejouer/ui/panel.py:639 +msgid "Sequence" +msgstr "Séquence" + +#: ../atoidejouer/ui/preview.py:48 +msgid "Sequence Graphics" +msgstr "Séquence d'Images" + +#: ../atoidejouer/ui/preview.py:49 +msgid "Sequence Sounds" +msgstr "Séquence de Son" + +#: ../atoidejouer/ui/notebook.py:364 +msgid "Sequences" +msgstr "Séquences" + +#: ../atoidejouer/ui/screens.py:795 +msgid "Smooth" +msgstr "Lissé" + +#: ../atoidejouer/ui/panel.py:1010 ../atoidejouer/ui/toolbar.py:435 +msgid "Sound" +msgstr "Son" + +#: ../atoidejouer/ui/toolbar.py:414 ../atoidejouer/ui/toolbar.py:442 +#: ../atoidejouer/ui/toolbar.py:471 +msgid "Stop Story" +msgstr "Arrêt Histoire" + +#: ../atoidejouer/ui/toolbar.py:463 +msgid "Story" +msgstr "Histoire" + +#: ../atoidejouer/ui/panel.py:590 +msgid "Time" +msgstr "Temps" diff --git a/po/fr.po b/po/fr.po deleted file mode 100644 index 21f5239..0000000 --- a/po/fr.po +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2010 -# This file is distributed under the same license as the Calendario package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: 3\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-12-29 16:47-0600\n" -"PO-Revision-Date: 2010-12-29 18:02-0600\n" -"Last-Translator: yaderv <yaderv@fedoraproject.org>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset= utf-8\n" -"Content-Transfer-Encoding: 8bit\n" diff --git a/po/messages.pot b/po/messages.pot new file mode 100644 index 0000000..41f302e --- /dev/null +++ b/po/messages.pot @@ -0,0 +1,363 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-04-29 12:42+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../atoidejouer/tools/storage.py:354 +#, python-format +msgid "" +"%s\n" +"\n" +"[Error] Can not load files!" +msgstr "" + +#: ../atoidejouer/tools/storage.py:373 +#, python-format +msgid "" +"%s\n" +"\n" +"[Error] Can not load keys!" +msgstr "" + +#: ../atoidejouer/tools/storage.py:336 +#, python-format +msgid "" +"%s\n" +"\n" +"[Error] Can not read archive file!" +msgstr "" + +#: ../atoidejouer/tools/storage.py:364 +#, python-format +msgid "" +"%s\n" +"\n" +"[Warning] Following files already exist:\n" +msgstr "" + +#: ../atoidejouer/tools/storage.py:383 +#, python-format +msgid "" +"%s\n" +"\n" +"[Warning] Following sequences already exist:\n" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:415 ../atoidejouer/ui/toolbar.py:421 +msgid "Add Graphic" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:443 ../atoidejouer/ui/toolbar.py:449 +msgid "Add Sound" +msgstr "" + +#: ../atoidejouer/ui/screens.py:772 +msgid "Advanced" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:422 ../atoidejouer/ui/toolbar.py:450 +msgid "Back" +msgstr "" + +#: ../atoidejouer/ui/screens.py:831 +msgid "Choose a File" +msgstr "" + +#: ../atoidejouer/ui/panel.py:498 +msgid "Choose a Sequence Item" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:473 +msgid "Default Screen" +msgstr "" + +#: ../atoidejouer/ui/panel.py:975 +msgid "Duration +10s" +msgstr "" + +#: ../atoidejouer/ui/panel.py:973 +msgid "Duration +1s" +msgstr "" + +#: ../atoidejouer/ui/panel.py:957 +msgid "Duration -10s" +msgstr "" + +#: ../atoidejouer/ui/panel.py:959 +msgid "Duration -1s" +msgstr "" + +#: ../atoidejouer/ui/screens.py:835 +msgid "EXPORT" +msgstr "" + +#: ../atoidejouer/ui/screens.py:767 +msgid "Easy" +msgstr "" + +#: ../atoidejouer/ui/screens.py:845 +#, python-format +msgid "Export to media '%s'" +msgstr "" + +#: ../atoidejouer/ui/screens.py:786 +msgid "FRAME RATE" +msgstr "" + +#: ../atoidejouer/ui/screens.py:798 +msgid "Faster" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:424 ../atoidejouer/ui/toolbar.py:452 +msgid "Frame After" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:423 ../atoidejouer/ui/toolbar.py:451 +msgid "Frame Before" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:472 +msgid "Fullscreen" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:407 +msgid "Graphic" +msgstr "" + +#: ../atoidejouer/ui/screens.py:828 +msgid "IMPORT" +msgstr "" + +#: ../atoidejouer/ui/panel.py:763 +msgid "Image" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:426 ../atoidejouer/ui/toolbar.py:454 +msgid "Import Sequence" +msgstr "" + +#: ../atoidejouer/ui/notebook.py:382 +msgid "Journal" +msgstr "" + +#: ../atoidejouer/ui/panel.py:647 +msgid "Key" +msgstr "" + +#: ../atoidejouer/ui/panel.py:785 +msgid "Layer to Bottom" +msgstr "" + +#: ../atoidejouer/ui/panel.py:802 +msgid "Layer to Top" +msgstr "" + +#: ../atoidejouer/ui/notebook.py:374 +msgid "Library" +msgstr "" + +#: ../atoidejouer/ui/panel.py:1000 +msgid "Loop (On/Off)" +msgstr "" + +#: ../atoidejouer/ui/panel.py:787 +msgid "Lower Layer" +msgstr "" + +#: ../atoidejouer/ui/screens.py:763 +msgid "MODE" +msgstr "" + +#: ../atoidejouer/ui/panel.py:865 +msgid "Move Down by 1%" +msgstr "" + +#: ../atoidejouer/ui/panel.py:868 +msgid "Move Down by 10%" +msgstr "" + +#: ../atoidejouer/ui/panel.py:838 +msgid "Move Left by 10%" +msgstr "" + +#: ../atoidejouer/ui/panel.py:858 +msgid "Move Right by 1%" +msgstr "" + +#: ../atoidejouer/ui/panel.py:860 +msgid "Move Right by 10%" +msgstr "" + +#: ../atoidejouer/ui/panel.py:833 ../atoidejouer/ui/panel.py:840 +msgid "Move Up by 1%" +msgstr "" + +#: ../atoidejouer/ui/panel.py:830 +msgid "Move Up by 10%" +msgstr "" + +#: ../atoidejouer/ui/notebook.py:323 +msgid "Name" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:428 +msgid "New Sequence" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:456 +msgid "New Sound" +msgstr "" + +#: ../atoidejouer/ui/screens.py:790 +msgid "Normal" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:411 ../atoidejouer/ui/toolbar.py:439 +#: ../atoidejouer/ui/toolbar.py:468 +msgid "Pause Story" +msgstr "" + +#: ../atoidejouer/ui/panel.py:617 +msgid "Play After (1 Frames)" +msgstr "" + +#: ../atoidejouer/ui/panel.py:619 +msgid "Play After (10 Frames)" +msgstr "" + +#: ../atoidejouer/ui/panel.py:604 +msgid "Play Before (1 Frames)" +msgstr "" + +#: ../atoidejouer/ui/panel.py:602 +msgid "Play Before (10 Frames)" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:412 ../atoidejouer/ui/toolbar.py:440 +#: ../atoidejouer/ui/toolbar.py:469 +msgid "Play Story" +msgstr "" + +#: ../atoidejouer/ui/panel.py:818 +msgid "Position" +msgstr "" + +#: ../atoidejouer/ui/notebook.py:322 +msgid "Preview" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:413 ../atoidejouer/ui/toolbar.py:441 +#: ../atoidejouer/ui/toolbar.py:470 +msgid "Progress Bar" +msgstr "" + +#: ../atoidejouer/tools/storage.py:489 +#, python-format +msgid "Project \"%(name)s\" already exported to \"%(media)s\"!" +msgstr "" + +#: ../atoidejouer/tools/storage.py:503 +#, python-format +msgid "Project \"%(name)s\" export to \"%(media)s\" failed!" +msgstr "" + +#: ../atoidejouer/tools/storage.py:496 +#, python-format +msgid "Project \"%(name)s\" sucessfully exported to \"%(media)s\"" +msgstr "" + +#: ../atoidejouer/tools/storage.py:335 ../atoidejouer/tools/storage.py:353 +#: ../atoidejouer/tools/storage.py:372 +msgid "Project import failed!" +msgstr "" + +#: ../atoidejouer/tools/storage.py:350 +msgid "Project sucessfully imported" +msgstr "" + +#: ../atoidejouer/ui/panel.py:800 +msgid "Raise Layer" +msgstr "" + +#: ../atoidejouer/ui/panel.py:625 +msgid "Remove" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:427 +msgid "Remove Graphic" +msgstr "" + +#: ../atoidejouer/ui/notebook.py:144 +msgid "Remove Item from Disk" +msgstr "" + +#: ../atoidejouer/ui/panel.py:649 +msgid "Remove Key" +msgstr "" + +#: ../atoidejouer/ui/panel.py:641 ../atoidejouer/ui/toolbar.py:430 +#: ../atoidejouer/ui/toolbar.py:458 +msgid "Remove Sequence" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:455 +msgid "Remove Sound" +msgstr "" + +#: ../atoidejouer/ui/panel.py:992 +msgid "Repeat" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:431 ../atoidejouer/ui/toolbar.py:459 +msgid "Save Sequence" +msgstr "" + +#: ../atoidejouer/ui/panel.py:639 +msgid "Sequence" +msgstr "" + +#: ../atoidejouer/ui/preview.py:48 +msgid "Sequence Graphics" +msgstr "" + +#: ../atoidejouer/ui/preview.py:49 +msgid "Sequence Sounds" +msgstr "" + +#: ../atoidejouer/ui/notebook.py:364 +msgid "Sequences" +msgstr "" + +#: ../atoidejouer/ui/screens.py:795 +msgid "Smooth" +msgstr "" + +#: ../atoidejouer/ui/panel.py:1010 ../atoidejouer/ui/toolbar.py:435 +msgid "Sound" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:414 ../atoidejouer/ui/toolbar.py:442 +#: ../atoidejouer/ui/toolbar.py:471 +msgid "Stop Story" +msgstr "" + +#: ../atoidejouer/ui/toolbar.py:463 +msgid "Story" +msgstr "" + +#: ../atoidejouer/ui/panel.py:590 +msgid "Time" +msgstr "" diff --git a/po/mki18n.py b/po/mki18n.py new file mode 100644 index 0000000..f4156d6 --- /dev/null +++ b/po/mki18n.py @@ -0,0 +1,459 @@ +#! /usr/bin/env python
+# -*- coding: iso-8859-1 -*-
+#
+# PYTHON MODULE: MKI18N.PY
+# =========
+#
+# Abstract: Make Internationalization (i18n) files for an application.
+#
+# Copyright Pierre Rouleau. 2003. Released to public domain.
+#
+# Last update: Saturday, November 8, 2003. @ 15:55:18.
+#
+# File: ROUP2003N01::C:/dev/python/mki18n.py
+#
+# RCS $Header: //software/official/MKS/MKS_SI/TV_NT/dev/Python/rcs/mki18n.py 1.5 2003/11/05 19:40:04 PRouleau Exp $
+#
+# Update history:
+#
+# - File created: Saturday, June 7, 2003. by Pierre Rouleau
+# - 10/06/03 rcs : RCS Revision 1.1 2003/06/10 10:06:12 PRouleau
+# - 10/06/03 rcs : RCS Initial revision
+# - 23/08/03 rcs : RCS Revision 1.2 2003/06/10 10:54:27 PRouleau
+# - 23/08/03 P.R.: [code:fix] : The strings encoded in this file are encode in iso-8859-1 format. Added the encoding
+# notification to Python to comply with Python's 2.3 PEP 263.
+# - 23/08/03 P.R.: [feature:new] : Added the '-e' switch which is used to force the creation of the empty English .mo file.
+# - 22/10/03 P.R.: [code] : incorporated utility functions in here to make script self sufficient.
+# - 05/11/03 rcs : RCS Revision 1.4 2003/10/22 06:39:31 PRouleau
+# - 05/11/03 P.R.: [code:fix] : included the unixpath() in this file.
+# - 08/11/03 rcs : RCS Revision 1.5 2003/11/05 19:40:04 PRouleau
+#
+# RCS $Log: $
+#
+#
+# -----------------------------------------------------------------------------
+"""
+mki18n allows you to internationalize your software. You can use it to
+create the GNU .po files (Portable Object) and the compiled .mo files
+(Machine Object).
+
+mki18n module can be used from the command line or from within a script (see
+the Usage at the end of this page).
+
+ Table of Contents
+ -----------------
+
+ makePO() -- Build the Portable Object file for the application --
+ catPO() -- Concatenate one or several PO files with the application domain files. --
+ makeMO() -- Compile the Portable Object files into the Machine Object stored in the right location. --
+ printUsage -- Displays how to use this script from the command line --
+
+ Scriptexecution -- Runs when invoked from the command line --
+
+
+NOTE: this module uses GNU gettext utilities.
+
+You can get the gettext tools from the following sites:
+
+ - `GNU FTP site for gettetx`_ where several versions (0.10.40, 0.11.2, 0.11.5 and 0.12.1) are available.
+ Note that you need to use `GNU libiconv`_ to use this. Get it from the `GNU
+ libiconv ftp site`_ and get version 1.9.1 or later. Get the Windows .ZIP
+ files and install the packages inside c:/gnu. All binaries will be stored
+ inside c:/gnu/bin. Just put c:/gnu/bin inside your PATH. You will need
+ the following files:
+
+ - `gettext-runtime-0.12.1.bin.woe32.zip`_
+ - `gettext-tools-0.12.1.bin.woe32.zip`_
+ - `libiconv-1.9.1.bin.woe32.zip`_
+
+
+.. _GNU libiconv: http://www.gnu.org/software/libiconv/
+.. _GNU libiconv ftp site: http://www.ibiblio.org/pub/gnu/libiconv/
+.. _gettext-runtime-0.12.1.bin.woe32.zip: ftp://ftp.gnu.org/gnu/gettext/gettext-runtime-0.12.1.bin.woe32.zip
+.. _gettext-tools-0.12.1.bin.woe32.zip: ftp://ftp.gnu.org/gnu/gettext/gettext-tools-0.12.1.bin.woe32.zip
+.. _libiconv-1.9.1.bin.woe32.zip: http://www.ibiblio.org/pub/gnu/libiconv/libiconv-1.9.1.bin.woe32.zip
+
+"""
+# -----------------------------------------------------------------------------
+# Module Import
+# -------------
+#
+import os
+import sys
+# import wx
+# -----------------------------------------------------------------------------
+# Global variables
+# ----------------
+#
+
+__author__ = "Pierre Rouleau"
+__version__= "$Revision: 1.5 $"
+
+# -----------------------------------------------------------------------------
+
+def getlanguageDict():
+ languageDict = {
+ 'en': '',
+ 'fr': ''
+ }
+ """
+ for lang in [x for x in dir(wx) if x.startswith("LANGUAGE")]:
+ i = wx.Locale(wx.LANGUAGE_DEFAULT).GetLanguageInfo(getattr(wx, lang))
+ if i:
+ languageDict[i.CanonicalName] = i.Description
+ """
+ return languageDict
+
+# -----------------------------------------------------------------------------
+# m a k e P O ( ) -- Build the Portable Object file for the application --
+# ^^^^^^^^^^^^^^^
+#
+def makePO(applicationDirectoryPath, applicationDomain=None, verbose=0) :
+ """Build the Portable Object Template file for the application.
+
+ makePO builds the .pot file for the application stored inside
+ a specified directory by running xgettext for all application source
+ files. It finds the name of all files by looking for a file called 'app.fil'.
+ If this file does not exists, makePo raises an IOError exception.
+ By default the application domain (the application
+ name) is the same as the directory name but it can be overridden by the
+ 'applicationDomain' argument.
+
+ makePO always creates a new file called messages.pot. If it finds files
+ of the form app_xx.po where 'app' is the application name and 'xx' is one
+ of the ISO 639 two-letter language codes, makePO resynchronizes those
+ files with the latest extracted strings (now contained in messages.pot).
+ This process updates all line location number in the language-specific
+ .po files and may also create new entries for translation (or comment out
+ some). The .po file is not changed, instead a new file is created with
+ the .new extension appended to the name of the .po file.
+
+ By default the function does not display what it is doing. Set the
+ verbose argument to 1 to force it to print its commands.
+ """
+
+ if applicationDomain is None:
+ applicationName = fileBaseOf(applicationDirectoryPath,withPath=0)
+ else:
+ applicationName = applicationDomain
+ currentDir = os.getcwd()
+ os.chdir(applicationDirectoryPath)
+ if not os.path.exists('app.fil'):
+ raise IOError(2,'No module file: app.fil')
+
+ # Steps:
+ # Use xgettext to parse all application modules
+ # The following switches are used:
+ #
+ # -s : sort output by string content (easier to use when we need to merge several .po files)
+ # --files-from=app.fil : The list of files is taken from the file: app.fil
+ # --output= : specifies the name of the output file (using a .pot extension)
+ cmd = 'xgettext -s --no-wrap --files-from=app.fil --output=messages.pot'
+ if verbose: print cmd
+ os.system(cmd)
+
+ languageDict = getlanguageDict()
+
+ for langCode in languageDict.keys():
+ if langCode == 'en':
+ pass
+ else:
+ langPOfileName = "%s_%s.po" % (applicationName , langCode)
+ if os.path.exists(langPOfileName):
+ cmd = 'msgmerge -s --no-wrap "%s" messages.pot > "%s.new"' % (langPOfileName, langPOfileName)
+ if verbose: print cmd
+ os.system(cmd)
+ os.chdir(currentDir)
+
+# -----------------------------------------------------------------------------
+# c a t P O ( ) -- Concatenate one or several PO files with the application domain files. --
+# ^^^^^^^^^^^^^
+#
+def catPO(applicationDirectoryPath, listOf_extraPo, applicationDomain=None, targetDir=None, verbose=0) :
+ """Concatenate one or several PO files with the application domain files.
+ """
+
+ if applicationDomain is None:
+ applicationName = fileBaseOf(applicationDirectoryPath,withPath=0)
+ else:
+ applicationName = applicationDomain
+ currentDir = os.getcwd()
+ os.chdir(applicationDirectoryPath)
+
+ languageDict = getlanguageDict()
+
+ for langCode in languageDict.keys():
+ if langCode == 'en':
+ pass
+ else:
+ langPOfileName = "%s_%s.po" % (applicationName , langCode)
+ if os.path.exists(langPOfileName):
+ fileList = ''
+ for fileName in listOf_extraPo:
+ fileList += ("%s_%s.po " % (fileName,langCode))
+ cmd = "msgcat -s --no-wrap %s %s > %s.cat" % (langPOfileName, fileList, langPOfileName)
+ if verbose: print cmd
+ os.system(cmd)
+ if targetDir is None:
+ pass
+ else:
+ mo_targetDir = "%s/%s/LC_MESSAGES" % (targetDir,langCode)
+ cmd = "msgfmt --output-file=%s/%s.mo %s_%s.po.cat" % (mo_targetDir,applicationName,applicationName,langCode)
+ if verbose: print cmd
+ os.system(cmd)
+ os.chdir(currentDir)
+
+# -----------------------------------------------------------------------------
+# m a k e M O ( ) -- Compile the Portable Object files into the Machine Object stored in the right location. --
+# ^^^^^^^^^^^^^^^
+#
+def makeMO(applicationDirectoryPath,targetDir='./locale',applicationDomain=None, verbose=0, forceEnglish=0) :
+ """Compile the Portable Object files into the Machine Object stored in the right location.
+
+ makeMO converts all translated language-specific PO files located inside
+ the application directory into the binary .MO files stored inside the
+ LC_MESSAGES sub-directory for the found locale files.
+
+ makeMO searches for all files that have a name of the form 'app_xx.po'
+ inside the application directory specified by the first argument. The
+ 'app' is the application domain name (that can be specified by the
+ applicationDomain argument or is taken from the directory name). The 'xx'
+ corresponds to one of the ISO 639 two-letter language codes.
+
+ makeMo stores the resulting files inside a sub-directory of `targetDir`
+ called xx/LC_MESSAGES where 'xx' corresponds to the 2-letter language
+ code.
+ """
+ if targetDir is None:
+ targetDir = './locale'
+ if verbose:
+ print "Target directory for .mo files is: %s" % targetDir
+
+ if applicationDomain is None:
+ applicationName = fileBaseOf(applicationDirectoryPath,withPath=0)
+ else:
+ applicationName = applicationDomain
+ currentDir = os.getcwd()
+ os.chdir(applicationDirectoryPath)
+
+ languageDict = getlanguageDict()
+
+ for langCode in languageDict.keys():
+ if (langCode == 'en') and (forceEnglish==0):
+ pass
+ else:
+ langPOfileName = "%s_%s.po" % (applicationName , langCode)
+ if os.path.exists(langPOfileName):
+ mo_targetDir = "%s/%s/LC_MESSAGES" % (targetDir,langCode)
+ if not os.path.exists(mo_targetDir):
+ mkdir(mo_targetDir)
+ cmd = 'msgfmt --output-file="%s/%s.mo" "%s_%s.po"' % (mo_targetDir,applicationName,applicationName,langCode)
+ if verbose: print cmd
+ os.system(cmd)
+ os.chdir(currentDir)
+
+# -----------------------------------------------------------------------------
+# p r i n t U s a g e -- Displays how to use this script from the command line --
+# ^^^^^^^^^^^^^^^^^^^
+#
+def printUsage(errorMsg=None) :
+ """Displays how to use this script from the command line."""
+ print """
+ ##################################################################################
+ # mki18n : Make internationalization files. #
+ # Uses the GNU gettext system to create PO (Portable Object) files #
+ # from source code, coimpile PO into MO (Machine Object) files. #
+ # Supports C,C++,Python source files. #
+ # #
+ # Usage: mki18n {OPTION} [appDirPath] #
+ # #
+ # Options: #
+ # -e : When -m is used, forces English .mo file creation #
+ # -h : prints this help #
+ # -m : make MO from existing PO files #
+ # -p : make PO, update PO files: Creates a new messages.pot #
+ # file. Creates a dom_xx.po.new for every existing #
+ # language specific .po file. ('xx' stands for the ISO639 #
+ # two-letter language code and 'dom' stands for the #
+ # application domain name). mki18n requires that you #
+ # write a 'app.fil' file which contains the list of all #
+ # source code to parse. #
+ # -v : verbose (prints comments while running) #
+ # --domain=appName : specifies the application domain name. By default #
+ # the directory name is used. #
+ # --moTarget=dir : specifies the directory where .mo files are stored. #
+ # If not specified, the target is './locale' #
+ # #
+ # You must specify one of the -p or -m option to perform the work. You can #
+ # specify the path of the target application. If you leave it out mki18n #
+ # will use the current directory as the application main directory. #
+ # #
+ ##################################################################################"""
+ if errorMsg:
+ print "\n ERROR: %s" % errorMsg
+
+# -----------------------------------------------------------------------------
+# f i l e B a s e O f ( ) -- Return base name of filename --
+# ^^^^^^^^^^^^^^^^^^^^^^^
+#
+def fileBaseOf(filename,withPath=0) :
+ """fileBaseOf(filename,withPath) ---> string
+
+ Return base name of filename. The returned string never includes the extension.
+ Use os.path.basename() to return the basename with the extension. The
+ second argument is optional. If specified and if set to 'true' (non zero)
+ the string returned contains the full path of the file name. Otherwise the
+ path is excluded.
+
+ [Example]
+ >>> fn = 'd:/dev/telepath/tvapp/code/test.html'
+ >>> fileBaseOf(fn)
+ 'test'
+ >>> fileBaseOf(fn)
+ 'test'
+ >>> fileBaseOf(fn,1)
+ 'd:/dev/telepath/tvapp/code/test'
+ >>> fileBaseOf(fn,0)
+ 'test'
+ >>> fn = 'abcdef'
+ >>> fileBaseOf(fn)
+ 'abcdef'
+ >>> fileBaseOf(fn,1)
+ 'abcdef'
+ >>> fn = "abcdef."
+ >>> fileBaseOf(fn)
+ 'abcdef'
+ >>> fileBaseOf(fn,1)
+ 'abcdef'
+ """
+ pos = filename.rfind('.')
+ if pos > 0:
+ filename = filename[:pos]
+ if withPath:
+ return filename
+ else:
+ return os.path.basename(filename)
+# -----------------------------------------------------------------------------
+# m k d i r ( ) -- Create a directory (and possibly the entire tree) --
+# ^^^^^^^^^^^^^
+#
+def mkdir(directory) :
+ """Create a directory (and possibly the entire tree).
+
+ The os.mkdir() will fail to create a directory if one of the
+ directory in the specified path does not exist. mkdir()
+ solves this problem. It creates every intermediate directory
+ required to create the final path. Under Unix, the function
+ only supports forward slash separator, but under Windows and MacOS
+ the function supports the forward slash and the OS separator (backslash
+ under windows).
+ """
+
+ # translate the path separators
+ directory = unixpath(directory)
+ # build a list of all directory elements
+ aList = filter(lambda x: len(x)>0, directory.split('/'))
+ theLen = len(aList)
+ # if the first element is a Windows-style disk drive
+ # concatenate it with the first directory
+ if aList[0].endswith(':'):
+ if theLen > 1:
+ aList[1] = aList[0] + '/' + aList[1]
+ del aList[0]
+ theLen -= 1
+ # if the original directory starts at root,
+ # make sure the first element of the list
+ # starts at root too
+ if directory[0] == '/':
+ aList[0] = '/' + aList[0]
+ # Now iterate through the list, check if the
+ # directory exists and if not create it
+ theDir = ''
+ for i in range(theLen):
+ theDir += aList[i]
+ if not os.path.exists(theDir):
+ os.mkdir(theDir)
+ theDir += '/'
+
+# -----------------------------------------------------------------------------
+# u n i x p a t h ( ) -- Return a path name that contains Unix separator. --
+# ^^^^^^^^^^^^^^^^^^^
+#
+def unixpath(thePath) :
+ r"""Return a path name that contains Unix separator.
+
+ [Example]
+ >>> unixpath(r"d:\test")
+ 'd:/test'
+ >>> unixpath("d:/test/file.txt")
+ 'd:/test/file.txt'
+ >>>
+ """
+ thePath = os.path.normpath(thePath)
+ if os.sep == '/':
+ return thePath
+ else:
+ return thePath.replace(os.sep,'/')
+
+# -----------------------------------------------------------------------------
+
+# S c r i p t e x e c u t i o n -- Runs when invoked from the command line --
+# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+#
+if __name__ == "__main__":
+ import getopt # command line parsing
+ argc = len(sys.argv)
+ if argc == 1:
+ printUsage('Missing argument: specify at least one of -m or -p (or both).')
+ sys.exit(1)
+ # If there is some arguments, parse the command line
+ validOptions = "ehmpv"
+ validLongOptions = ['domain=', 'moTarget=']
+ option = {}
+ option['forceEnglish'] = 0
+ option['mo'] = 0
+ option['po'] = 0
+ option['verbose'] = 0
+ option['domain'] = None
+ option['moTarget'] = None
+ try:
+ optionList,pargs = getopt.getopt(sys.argv[1:],validOptions,validLongOptions)
+ except getopt.GetoptError, e:
+ printUsage(e[0])
+ sys.exit(1)
+ for (opt,val) in optionList:
+ if (opt == '-h'):
+ printUsage()
+ sys.exit(0)
+ elif (opt == '-e'): option['forceEnglish'] = 1
+ elif (opt == '-m'): option['mo'] = 1
+ elif (opt == '-p'): option['po'] = 1
+ elif (opt == '-v'): option['verbose'] = 1
+ elif (opt == '--domain'): option['domain'] = val
+ elif (opt == '--moTarget'): option['moTarget'] = val
+ if len(pargs) == 0:
+ appDirPath = os.getcwd()
+ if option['verbose']:
+ print "No project directory given. Using current one: %s" % appDirPath
+ elif len(pargs) == 1:
+ appDirPath = pargs[0]
+ else:
+ printUsage('Too many arguments (%u). Use double quotes if you have space in directory name' % len(pargs))
+ sys.exit(1)
+ if option['domain'] is None:
+ # If no domain specified, use the name of the target directory
+ option['domain'] = fileBaseOf(appDirPath)
+ if option['verbose']:
+ print "Application domain used is: '%s'" % option['domain']
+ if option['po']:
+ try:
+ makePO(appDirPath,option['domain'],option['verbose'])
+ except IOError, e:
+ printUsage(e[1] + '\n You must write a file app.fil that contains the list of all files to parse.')
+ if option['mo']:
+ makeMO(appDirPath,option['moTarget'],option['domain'],option['verbose'],option['forceEnglish'])
+ sys.exit(1)
+
+
+# -----------------------------------------------------------------------------
+
|