diff --git a/.gitignore b/.gitignore index 01425df..9f0c5d1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ build/ .kdev4/ L7.kdev4 docs/ +Resources/Lokalize/main.lqa +Resources/Lokalize/fr/L7.mo diff --git a/Resources/Lokalize/0_getstrings.sh b/Resources/Lokalize/0_getstrings.sh new file mode 100755 index 0000000..ba7eee2 --- /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=L7 +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/special -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/special -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..ba51088 --- /dev/null +++ b/Resources/Lokalize/2_makemo.sh @@ -0,0 +1,14 @@ +#!/bin/bash +if [ ! -x 2_makemo.sh ] +then + echo "Wrong working directory. Please cd to the directory containing this script." + exit 0 +fi + +APPNAME=L7 +DOMAIN=fr + +msgfmt $DOMAIN/$APPNAME.po -o $DOMAIN/$APPNAME.mo + +exit 0 + diff --git a/Resources/Lokalize/fr/L7.po b/Resources/Lokalize/fr/L7.po new file mode 100644 index 0000000..ad21608 --- /dev/null +++ b/Resources/Lokalize/fr/L7.po @@ -0,0 +1,86 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-10-15 21:04+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../LNavigator.cpp:20 +msgid "New" +msgstr "Nouveau" + +#: ../../LNavigator.cpp:22 ../../LBoundGrid.cpp:559 +msgid "Save" +msgstr "Enregistrer" + +#: ../../LNavigator.cpp:24 ../../LBoundGrid.cpp:561 +msgid "Cancel" +msgstr "Annuler" + +#: ../../LNavigator.cpp:26 ../../LBoundGrid.cpp:567 +msgid "Refresh" +msgstr "Rafraîchir" + +#: ../../LNavigator.cpp:28 ../../LBoundGrid.cpp:563 +msgid "Delete" +msgstr "Supprimer" + +#: ../../LNavigator.cpp:36 ../../LNavigator.cpp:228 +msgid "Rec : " +msgstr "Enr :" + +#: ../../LNavigator.cpp:222 +msgid "Insert" +msgstr "Insérér" + +#: ../../LBoundCheckBox.cpp:109 ../../LBoundCheckBox.cpp:112 +msgid "Yes" +msgstr "Oui" + +#: ../../LBoundCheckBox.cpp:110 ../../LBoundCheckBox.cpp:113 +msgid "No" +msgstr "Non" + +#: ../../LGridCheckRenderer.cpp:52 ../../LGridCheckRenderer.cpp:65 +msgid "no" +msgstr "non" + +#: ../../LBoundGrid.cpp:571 ../../LBoundGrid.cpp:672 +msgid "Form view" +msgstr "Vue formulaire" + +#: ../../LSQResultSet.h:27 ../../LPQResultSet.h:28 +msgid "" +"Insert started\n" +"Please SAVE or CANCEL first" +msgstr "" +"Insertion démarrée\n" +"Veuillez d'abord ENREGISTRER ou ANNULER" + +#: ../../LSQResultSet.h:29 ../../LPQResultSet.h:30 +msgid "Unknown error" +msgstr "Erreur inconnue" + +#: ../../LSQResultSet.h:31 ../../LPQResultSet.h:32 +msgid "" +"Data altered\n" +"Please SAVE or CANCEL first" +msgstr "" +"Données modifiées\n" +"Veuillez d'abord ENREGISTRER ou ANNULER" + +#: ../..//special/BaseGridPicker.h:16 +msgid "[Invalid]" +msgstr "[Invalide]" diff --git a/Resources/Lokalize/index.lokalize b/Resources/Lokalize/index.lokalize new file mode 100644 index 0000000..3338606 --- /dev/null +++ b/Resources/Lokalize/index.lokalize @@ -0,0 +1,6 @@ +[General] +LangCode=fr +LanguageSource=Automatic +MailingList= +ProjectID=L7-Lokalize +TargetLangCode=fr diff --git a/Test/L7Test.cpp b/Test/L7Test.cpp index 0b5394a..7663b09 100644 --- a/Test/L7Test.cpp +++ b/Test/L7Test.cpp @@ -31,6 +31,12 @@ bool L7Test::OnInit() { L7Frame * main = new L7Frame(NULL, wxID_ANY, _T("L7 Test")); SetAppName(_T("L7Test")); + + // Fails here : L7.mo in dir containing L7Test, or in /usr/local/share/locale/fr/LC_MESSAGES/. + m_locale.Init(wxLANGUAGE_DEFAULT); + wxTranslations::Get()->AddStdCatalog(); + m_locale.AddCatalog(_T("L7")); + SetTopWindow(main); main->Show(); return true; diff --git a/Test/L7Test.h b/Test/L7Test.h index 698c5e5..8052093 100644 --- a/Test/L7Test.h +++ b/Test/L7Test.h @@ -37,7 +37,7 @@ public: private: - + wxLocale m_locale; }; class L7Frame : public wxFrame