From 4aca5126c37b277b7ed5badda5d2e0163ca89c47 Mon Sep 17 00:00:00 2001 From: SET Date: Mon, 17 Oct 2022 18:50:49 +0200 Subject: [PATCH] Add localization resources. --- Resources/Lokalize/0_getstrings.sh | 21 ++++ Resources/Lokalize/2_makemo.sh | 16 +++ Resources/Lokalize/fr/T7.po | 183 +++++++++++++++++++++++++++++ Resources/Lokalize/index.lokalize | 5 + Resources/UI/t7app.cpp | 5 +- Resources/UI/t7app.h | 2 + XT7Main.cpp | 2 +- 7 files changed, 232 insertions(+), 2 deletions(-) create mode 100755 Resources/Lokalize/0_getstrings.sh create mode 100755 Resources/Lokalize/2_makemo.sh create mode 100644 Resources/Lokalize/fr/T7.po create mode 100644 Resources/Lokalize/index.lokalize diff --git a/Resources/Lokalize/0_getstrings.sh b/Resources/Lokalize/0_getstrings.sh new file mode 100755 index 0000000..b9a7f93 --- /dev/null +++ b/Resources/Lokalize/0_getstrings.sh @@ -0,0 +1,21 @@ +#!/bin/bash +if [ ! -x 0_getstrings.sh ] +then + echo "Wrong working directory. Please cd to the directory containing this script." + exit 0 +fi + +APPNAME=T7 +SRC=../../ +DOMAIN=fr +DEST=$DOMAIN/$APPNAME.po +[ ! -d $DOMAIN ] && mkdir $DOMAIN +[ -f $DEST ] && JOIN="-j" +[ -f $DEST ] && cp $DEST $DEST.bak-$(date +%F-%T) + +xgettext --keyword=_ -d $DOMAIN $JOIN -o $DEST --c++ --from-code=UTF-8 $(find $SRC -maxdepth 1 -type f -name "*.cpp") +xgettext --keyword=_ -d $DOMAIN -j -o $DEST --c++ --from-code=UTF-8 $(find $SRC -maxdepth 1 -type f -name "*.h") +xgettext --keyword=_ -d $DOMAIN -j -o $DEST --c++ --from-code=UTF-8 $(find $SRC/Resources/UI -maxdepth 1 -type f -name "*.cpp") +xgettext --keyword=_ -d $DOMAIN -j -o $DEST --c++ --from-code=UTF-8 $(find $SRC/Resources/UI -maxdepth 1 -type f -name "*.h") + +exit 0 diff --git a/Resources/Lokalize/2_makemo.sh b/Resources/Lokalize/2_makemo.sh new file mode 100755 index 0000000..497b560 --- /dev/null +++ b/Resources/Lokalize/2_makemo.sh @@ -0,0 +1,16 @@ +#!/bin/bash +if [ ! -x 2_makemo.sh ] +then + echo "Wrong working directory. Please cd to the directory containing this script." + exit 0 +fi + +APPNAME=T7 +DOMAIN=fr + +msgfmt $DOMAIN/$APPNAME.po -o $DOMAIN/$APPNAME.mo + +# cp $DOMAIN/$APPNAME.mo /usr/local/share/locale/$DOMAIN/LC_MESSAGES/ + +exit 0 + diff --git a/Resources/Lokalize/fr/T7.po b/Resources/Lokalize/fr/T7.po new file mode 100644 index 0000000..f584394 --- /dev/null +++ b/Resources/Lokalize/fr/T7.po @@ -0,0 +1,183 @@ +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Saleem EDAH-TALLY , 2022. +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-10-17 16:03+0200\n" +"PO-Revision-Date: 2022-10-17 18:29+0200\n" +"Last-Translator: Saleem EDAH-TALLY \n" +"Language-Team: French <>\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Lokalize 22.08.2\n" + +#: ../../XT7Main.cpp:47 +msgid "Incomplete device configuration." +msgstr "Configuration du périphérique incomplète." + +#: ../../XT7Main.cpp:110 +msgid "Left" +msgstr "Gauche" + +#: ../../XT7Main.cpp:111 +msgid "Middle" +msgstr "Milieu" + +#: ../../XT7Main.cpp:112 +msgid "Right" +msgstr "Droit" + +#: ../../XT7Main.cpp:113 ../../XT7Main.cpp:116 ../../XT7Main.cpp:119 +msgid "Rewind" +msgstr "Retour arrière" + +#: ../../XT7Main.cpp:114 ../../XT7Main.cpp:117 ../../XT7Main.cpp:120 +msgid "Fast forward" +msgstr "Avance rapide" + +#: ../../XT7Main.cpp:115 ../../XT7Main.cpp:118 ../../XT7Main.cpp:121 +msgid "Play" +msgstr "Lecture" + +#: ../../XT7Main.cpp:206 +msgid "Device saved. Proceed to pedal identification." +msgstr "Périphérique enregistré. Procédez à l'identification des pédales." + +#: ../../XT7Main.cpp:211 +msgid "Can't save selected device in configuration." +msgstr "Échec de sauvegarde du périphérique sélectionné." + +#: ../../XT7Main.cpp:229 +msgid "Choices are not consistent." +msgstr "Choix inconsistants." + +#: ../../XT7Main.cpp:301 +msgid "Saved. You may identify another pedal." +msgstr "Enregistré. Vous pouvez identifier une autre pédale." + +#: ../../XT7Main.cpp:304 +msgid "This window will close. Please start again." +msgstr "Cette fenêtre va être fermée. Veuillez recommencer." + +#: ../../XT7Main.cpp:443 +msgid "Date" +msgstr "Date" + +#: ../../XT7Main.cpp:444 +msgid "Length" +msgstr "Durée" + +#: ../../XT7Main.cpp:445 +msgid "File" +msgstr "Fichier" + +#: ../../XT7Main.cpp:471 +msgid "" +"Can't communicate with the pedal device. After resolving the problem, " +"please restart the application.\n" +"\n" +" Keyboard control : F5, F6, F7, ESC." +msgstr "" +"Ne peut communiquer avec le pédalier. Après avoir résolu le problème, " +"veuillez redémarrer l'application.\n" +"\n" +"Au clavier : F5, F6, F7, ESC." + +#: ../../XT7Main.cpp:481 +msgid "Author and copyright :" +msgstr "Auteur et copyright :" + +#: ../../XT7Main.cpp:484 +msgid "LGPL license" +msgstr "Sous licence LGPL" + +#: ../../XT7Main.cpp:541 ../../XT7Main.cpp:558 ../../XT7Main.cpp:574 +msgid "Action is not rightly declared." +msgstr "Action mal déclarée." + +#: ../..//Resources/UI/t7main.cpp:158 +msgid "Position" +msgstr "Position" + +#: ../..//Resources/UI/t7main.cpp:161 +msgid "Total" +msgstr "Total" + +#: ../..//Resources/UI/t7main.cpp:168 +msgid "Refresh" +msgstr "Rafraîchir" + +#: ../..//Resources/UI/t7main.cpp:170 +msgid "Update file list." +msgstr "Mettre à jour la liste de fichiers." + +#: ../..//Resources/UI/t7main.cpp:175 +msgid "Media source directory." +msgstr "Dossier source des médias." + +#: ../..//Resources/UI/t7main.cpp:178 +msgid "Device configuration" +msgstr "Configuration du périphérique" + +#: ../..//Resources/UI/t7main.cpp:183 +msgid "Device" +msgstr "Périphérique" + +#: ../..//Resources/UI/t7main.cpp:185 +msgid "You should not play with these parameters once rightly set." +msgstr "" +"Vous ne devriez pas jouer avec ces paramètres une fois correctement définis." + +#: ../..//Resources/UI/t7main.cpp:192 +msgid "1. Select a device" +msgstr "1. Sélection du périphérique" + +#: ../..//Resources/UI/t7main.cpp:201 +msgid "2. Press pedal" +msgstr "2. Appuyez sur une pédale" + +#: ../..//Resources/UI/t7main.cpp:207 +msgid "You should not play with this once rightly configured." +msgstr "Vous ne devriez pas jouer avec ceci une fois correctement établi." + +#: ../..//Resources/UI/t7main.cpp:213 +msgid "About" +msgstr "A propos" + +#: ../..//Resources/UI/t7main.cpp:218 +msgid "Actions" +msgstr "Actions" + +#: ../..//Resources/UI/t7main.cpp:224 +msgid "Left pedal" +msgstr "Pédale de gauche" + +#: ../..//Resources/UI/t7main.cpp:230 +msgid "Middle pedal" +msgstr "Pédale du milieu" + +#: ../..//Resources/UI/t7main.cpp:236 +msgid "Right pedal" +msgstr "Pédale de droite" + +#: ../..//Resources/UI/t7main.cpp:241 +msgid "Auto-rewind on playback suspend" +msgstr "Retour arrière à l'arrêt de le lecture" + +#: ../..//Resources/UI/t7main.cpp:244 +msgid "1000" +msgstr "" + +#: ../..//Resources/UI/t7main.cpp:247 +msgid "Milliseconds; press Enter to save." +msgstr "Millisecondes; appuyez sur ENTRÉE pour sauvegarder." + +#: ../..//Resources/UI/t7main.h:65 +msgid "T7" +msgstr "" diff --git a/Resources/Lokalize/index.lokalize b/Resources/Lokalize/index.lokalize new file mode 100644 index 0000000..bc244ee --- /dev/null +++ b/Resources/Lokalize/index.lokalize @@ -0,0 +1,5 @@ +[General] +LangCode=fr +MailingList= +ProjectID=T-Lokalize +TargetLangCode=fr diff --git a/Resources/UI/t7app.cpp b/Resources/UI/t7app.cpp index bc56b82..2750f37 100644 --- a/Resources/UI/t7app.cpp +++ b/Resources/UI/t7app.cpp @@ -102,8 +102,11 @@ bool T7App::OnInit() #endif ////@end T7App initialisation - wxSetlocale(LC_ALL, ""); SetAppName(_APPNAME_T7_); + m_locale.Init(wxLANGUAGE_DEFAULT); + wxTranslations::Get()->AddStdCatalog(); + m_locale.AddCatalog(_APPNAME_T7_); + SetExitOnFrameDelete(true); XT7Main * main = new XT7Main( NULL); SetTopWindow(main); diff --git a/Resources/UI/t7app.h b/Resources/UI/t7app.h index 09db341..7d72e0a 100644 --- a/Resources/UI/t7app.h +++ b/Resources/UI/t7app.h @@ -67,6 +67,8 @@ public: ////@begin T7App member variables ////@end T7App member variables +private: + wxLocale m_locale; }; /*! diff --git a/XT7Main.cpp b/XT7Main.cpp index b345cdf..83ba973 100644 --- a/XT7Main.cpp +++ b/XT7Main.cpp @@ -468,7 +468,7 @@ void XT7Main::SetStreamError() { streamError = true; // We request application restart when stream is established again. // We don't try to detect if the problem is resolved. Restart is cheap. - MessageBox(_("Can't communication with the pedal device. After resolving the problem," + MessageBox(_("Can't communicate with the pedal device. After resolving the problem," " please restart the application." "\n\n Keyboard control : F5, F6, F7, ESC."), true); medMain->Stop();