From 205841d6c46cf0e5abce71a6e1e7b7ad7f3f088a Mon Sep 17 00:00:00 2001 From: RickS Date: Tue, 20 Sep 2016 20:03:50 +0200 Subject: [PATCH] Test sample for context-sensitive translations --- samples/internat/fr/internat.mo | Bin 1368 -> 1708 bytes samples/internat/fr/internat.po | 42 ++++++++++++++++++++++++++++---- samples/internat/internat.cpp | 23 ++++++++++++++++- 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/samples/internat/fr/internat.mo b/samples/internat/fr/internat.mo index ec2d79a202471ce923e6a5e07da75b42f95b57db..8c3117507012d35a911899a2f0a2c878afb22c36 100644 GIT binary patch delta 777 zcmYL`&ubGw6vtVl;_fx}fGu2m$I6=;n zpU4Gr;IR-t;C}cM?t_2fQTPu|!s&^TKM#+f&pRYgi--U-@4xcd8pwxdT9>n*US{nOM`Yb@X$Rf)u z{nauXjj;|J@HUh`?!YN`YBG+=(Etk4M<5nhKJ#x)Gtc?vea)%{T6!k zcOf^Cz;m~eiFpY3q(B`b;xFNO?(#DOr{--Oc)i zTH0)PcAt3-Z{uE;7N*)RlCBzUd+oHP9(DS;({`_9t9vE)`?1{qIPq}KhNc#TYk>{5 zS&J^#FN8J>x0{unJ6jwUcY@6<@Ae{{%Gq(J*R%~i+BVOndR?3I4gXr4w)$}^32r2D zH_~Gr=?A%gGq{qZNgfwj9_g(tx!*3dS*fqA?tZB}^=dMbQ8JTp;~OQ8b&hq8bx!D< I&^e*{57oJLwEzGB delta 428 zcmXxgJx>Bb5P;!1?*K(k2?mM5Vhck7p|CLqsw0wUftT1}NoQq6f(ZmF{s0&YD5;1Y z6%~KMPHAjtX|*sW`p$7oGW+b_e$4H@x*zfGXUcgNB1xW-V=|+Ci-u@n6rV7HJ=C>* zOyEoSeS!y!r+AEWyui0`KDHy0V(j828qA7xrA|i+G*Jt;F^@w$Ve # -#: internat.cpp:146 -#, fuzzy msgid "" msgstr "" "Project-Id-Version: wxWindows 2.0 i18n sample\n" "POT-Creation-Date: 1999-01-13 18:19+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: 2016-09-20 19:38+0200\n" "Last-Translator: Vadim Zeitlin \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" +"Language-Team: \n" +"Language: fr\n" +"X-Generator: Poedit 1.8.7\n" + +msgid "item" +msgstr "item0" + +msgctxt "cont1" +msgid "item" +msgstr "item1" + +msgctxt "cont2" +msgid "item" +msgstr "item2" + +msgid "sing" +msgid_plural "plur" +msgstr[0] "sing0" +msgstr[1] "plur0" + +msgctxt "cont1" +msgid "sing" +msgid_plural "plur" +msgstr[0] "sing1" +msgstr[1] "plur1" + +msgctxt "cont2" +msgid "sing" +msgid_plural "plur" +msgstr[0] "sing2" +msgstr[1] "plur2" #: internat.cpp:98 msgid "International wxWindows App" @@ -43,9 +73,11 @@ msgid "&Test" msgstr "&Test" #: internat.cpp:138 -msgid "I18n sample\n" +msgid "" +"I18n sample\n" "© 1998, 1999 Vadim Zeitlin and Julian Smart" -msgstr "Exemple d'i18n\n" +msgstr "" +"Exemple d'i18n\n" "© 1998, 1999 Vadim Zeitlin et Julian Smart" #: internat.cpp:139 diff --git a/samples/internat/internat.cpp b/samples/internat/internat.cpp index 5f2646f9fe..f3f706d9c3 100644 --- a/samples/internat/internat.cpp +++ b/samples/internat/internat.cpp @@ -94,7 +94,16 @@ enum INTERNAT_TEST_1, INTERNAT_TEST_2, INTERNAT_TEST_3, - INTERNAT_TEST_MSGBOX + INTERNAT_TEST_MSGBOX, + INTERNAT_MACRO_1, + INTERNAT_MACRO_2, + INTERNAT_MACRO_3, + INTERNAT_MACRO_4, + INTERNAT_MACRO_5, + INTERNAT_MACRO_6, + INTERNAT_MACRO_7, + INTERNAT_MACRO_8, + INTERNAT_MACRO_9 }; // language data @@ -308,9 +317,21 @@ MyFrame::MyFrame(wxLocale& locale) test_menu->Append(INTERNAT_TEST_MSGBOX, _("&Message box test"), _("Tests message box buttons labels translation")); + wxMenu *macro_menu = new wxMenu; + macro_menu->Append(INTERNAT_MACRO_1, _("item")); + macro_menu->Append(INTERNAT_MACRO_2, wxCONTEXT("cont1", "item")); + macro_menu->Append(INTERNAT_MACRO_3, wxCONTEXT("cont2", "item")); + macro_menu->Append(INTERNAT_MACRO_4, wxPLURAL("sing", "plur", 1)); + macro_menu->Append(INTERNAT_MACRO_5, wxPLURAL("sing", "plur", 2)); + macro_menu->Append(INTERNAT_MACRO_6, wxCONTEXTPLURAL("cont1", "sing", "plur", 1)); + macro_menu->Append(INTERNAT_MACRO_7, wxCONTEXTPLURAL("cont1", "sing", "plur", 2)); + macro_menu->Append(INTERNAT_MACRO_8, wxCONTEXTPLURAL("cont2", "sing", "plur", 1)); + macro_menu->Append(INTERNAT_MACRO_9, wxCONTEXTPLURAL("cont2", "sing", "plur", 2)); + wxMenuBar *menu_bar = new wxMenuBar; menu_bar->Append(file_menu, _("&File")); menu_bar->Append(test_menu, _("&Test")); + menu_bar->Append(macro_menu, _("&Macro")); SetMenuBar(menu_bar); // this demonstrates RTL support in wxStatusBar: