Merge branch 'i18n-context'

Closes https://github.com/wxWidgets/wxWidgets/pull/530
This commit is contained in:
Vadim Zeitlin
2017-08-09 20:47:41 +02:00
7 changed files with 150 additions and 27 deletions

Binary file not shown.

View File

@@ -2,17 +2,47 @@
# Copyright (C) 1999 wxWindows development team
# Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
#
#: 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 <zeitlin@dptmaths.ens-cachan.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"
"Language-Team: \n"
"Language: fr\n"
"X-Generator: Poedit 1.8.7\n"
msgid "item"
msgstr "Item without context"
msgctxt "context_1"
msgid "item"
msgstr "Item in context 1"
msgctxt "context_2"
msgid "item"
msgstr "Item in context 2"
msgid "sing"
msgid_plural "plur"
msgstr[0] "Singular form without context"
msgstr[1] "Plural form without context"
msgctxt "context_1"
msgid "sing"
msgid_plural "plur"
msgstr[0] "Singular form in context 1"
msgstr[1] "Plural form in context 1"
msgctxt "context_2"
msgid "sing"
msgid_plural "plur"
msgstr[0] "Singular form in context 2"
msgstr[1] "Plural form in context 2"
#: 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

View File

@@ -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,23 @@ MyFrame::MyFrame(wxLocale& locale)
test_menu->Append(INTERNAT_TEST_MSGBOX, _("&Message box test"),
_("Tests message box buttons labels translation"));
// Note that all these strings are currently "translated" only in French
// catalog, so you need to use French locale to see them in action.
wxMenu *macro_menu = new wxMenu;
macro_menu->Append(INTERNAT_MACRO_1, _("item"));
macro_menu->Append(INTERNAT_MACRO_2, wxGETTEXT_IN_CONTEXT("context_1", "item"));
macro_menu->Append(INTERNAT_MACRO_3, wxGETTEXT_IN_CONTEXT("context_2", "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, wxGETTEXT_IN_CONTEXT_PLURAL("context_1", "sing", "plur", 1));
macro_menu->Append(INTERNAT_MACRO_7, wxGETTEXT_IN_CONTEXT_PLURAL("context_1", "sing", "plur", 2));
macro_menu->Append(INTERNAT_MACRO_8, wxGETTEXT_IN_CONTEXT_PLURAL("context_2", "sing", "plur", 1));
macro_menu->Append(INTERNAT_MACRO_9, wxGETTEXT_IN_CONTEXT_PLURAL("context_2", "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: