diff --git a/test/extract_pot.sh b/test/extract_pot.sh index 2af58e0..17f95cd 100644 --- a/test/extract_pot.sh +++ b/test/extract_pot.sh @@ -1,2 +1,2 @@ #!/bin/sh -xgettext -o test.pot -k_ -k"_LC:1c,2" -s -c --package-name=moFileReader test.cpp \ No newline at end of file +xgettext -o test.pot -k"_L" -k"_LC:1c,2" -s -c --package-name=moFileReader --from-code=UTF-8 test.cpp \ No newline at end of file diff --git a/test/languages/nl.mo b/test/languages/nl.mo index 3510228..54b5622 100644 Binary files a/test/languages/nl.mo and b/test/languages/nl.mo differ diff --git a/test/languages/nl.po b/test/languages/nl.po index b93fc04..366642b 100644 --- a/test/languages/nl.po +++ b/test/languages/nl.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: moFileReader\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-12-13 14:39+0100\n" -"PO-Revision-Date: 2021-08-25 09:01+0000\n" +"POT-Creation-Date: 2021-10-16 11:52+0200\n" +"PO-Revision-Date: 2021-10-16 11:53+0200\n" "Last-Translator: Edgar \n" "Language-Team: Dutch \n" @@ -17,53 +17,61 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.8\n" +"X-Generator: Poedit 3.0\n" + +#: test.cpp:60 +msgid "" +"De naam 'Omrop Fryslân' houdt in: Regionaal herkenbaar, actueel, " +"onafhankelijk, betrouwbaar, toegankelijk, vermakelijk en divers" +msgstr "" +"De namme ‘Omrop Fryslân’ hâldt yn: regionaal werkenber, aktueel, " +"ûnôfhinklik, betrouber, tagonklik, ûnderhâldend en divers" + +#: test.cpp:63 +msgid "I 💚 Fryslân" +msgstr "Ik 💚 Friesland" + +#: test.cpp:58 +msgid "" +"Omrop Fryslân makket radio en telefyzje yn it Frysk, dêrmei is de omrop de " +"ienige stjoerder fan Nederlân dy’t net yn it Nederlânsk útstjoert" +msgstr "" +"Omrop Fryslân maakt radio en televisie in het Fries, daarmee is de omroep de " +"enige zender van Nederland die niet in het Nederlanders uitzendt" #. This is the first comment. -#: test.cpp:31 +#: test.cpp:71 msgctxt "TEST|String|1" msgid "String English" msgstr "Text Nederlands Een" #. This is the second comment. -#: test.cpp:33 +#: test.cpp:73 msgctxt "TEST|String|2" msgid "String English" msgstr "Text Nederlands Twee" #. This is the third comment. -#: test.cpp:35 +#: test.cpp:75 msgctxt "TEST|String|3" msgid "String English" msgstr "Text Nederlands Drie" #. This is the first comment. -#: test.cpp:19 +#: test.cpp:46 msgid "String English One" msgstr "Text Nederlands Een" #. This is the third comment. -#: test.cpp:23 +#: test.cpp:50 msgid "String English Three" msgstr "Text Nederlands Drie" #. This is the second comment. -#: test.cpp:21 +#: test.cpp:48 msgid "String English Two" msgstr "Text Nederlands Twee" -#~ msgctxt "TEST|String|1" -#~ msgid "String English One" -#~ msgstr "Text Nederlands Een" - -#~ msgctxt "TEST|String|3" -#~ msgid "String English Three" -#~ msgstr "Text Nederlands Drie" - -#~ msgctxt "TEST|String|2" -#~ msgid "String English Two" -#~ msgstr "Text Nederlands Twee" - -#~ msgctxt "Menu|" -#~ msgid "File" -#~ msgstr "Bestand" +#: test.cpp:62 +msgid "geändert ß" +msgstr "veranderd ß" diff --git a/test/test.cpp b/test/test.cpp index 376f734..2d2aba0 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -24,7 +24,7 @@ TEST_CASE("Count number of strings", "[Count]") { moFileReader moFR; moFR.ReadFile(MO_TEST_FILE); - CHECK(7 == moFR.GetNumStrings()); + CHECK(11 == moFR.GetNumStrings()); } TEST_CASE("Empties the Lookup-Table", "[Count]") @@ -32,7 +32,7 @@ TEST_CASE("Empties the Lookup-Table", "[Count]") moFileReader moFR; moFR.ReadFile(MO_TEST_FILE); CHECK("Text Nederlands Een" == moFR.Lookup("String English One")); - CHECK(7 == moFR.GetNumStrings()); + CHECK(11 == moFR.GetNumStrings()); moFR.ClearTable(); CHECK("String English One" == moFR.Lookup("String English One")); CHECK(0 == moFR.GetNumStrings()); @@ -50,6 +50,19 @@ TEST_CASE("Lookup string", "[Lookup]") CHECK("Text Nederlands Drie" == _L("String English Three")); } +TEST_CASE("Lookup string with unicode", "[LookupUnicode]") +{ + moFileReader moFR; + moFR.ReadFile(MO_TEST_FILE); + CHECK("Omrop Fryslân maakt radio en televisie in het Fries, daarmee is de omroep de enige zender van Nederland die niet in het Nederlanders uitzendt" + == _L("Omrop Fryslân makket radio en telefyzje yn it Frysk, dêrmei is de omrop de ienige stjoerder fan Nederlân dy’t net yn it Nederlânsk útstjoert")); + CHECK("De namme ‘Omrop Fryslân’ hâldt yn: regionaal werkenber, aktueel, ûnôfhinklik, betrouber, tagonklik, ûnderhâldend en divers" + == _L("De naam 'Omrop Fryslân' houdt in: Regionaal herkenbaar, actueel, onafhankelijk, betrouwbaar, toegankelijk, vermakelijk en divers")); + CHECK("Bûter, brea en brûne sûker" == moFR.Lookup("Bûter, brea en brûne sûker")); + CHECK("veranderd ß" == _L("geändert ß")); + CHECK("Ik 💚 Friesland" == _L("I 💚 Fryslân")); +} + TEST_CASE("Lookup string with context", "[LookupWithContext]") { moFileReader moFR; @@ -74,6 +87,6 @@ TEST_CASE("Lookup not existing strings with context", "[LookupWithContext-fail]" { moFileReader moFR; moFR.ReadFile(MO_TEST_FILE); - CHECK("String English" == _LC("Nope", "String English")); - CHECK("Not this one" == _LC("TEST|String|1", "Not this one")); + CHECK("String English" == moFR.LookupWithContext("Nope", "String English")); + CHECK("Not this one" == moFR.LookupWithContext("TEST|String|1", "Not this one")); } \ No newline at end of file diff --git a/test/test.pot b/test/test.pot index 4e74c1e..315b559 100644 --- a/test/test.pot +++ b/test/test.pot @@ -8,44 +8,64 @@ msgid "" msgstr "" "Project-Id-Version: moFileReader\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-12-13 14:39+0100\n" +"POT-Creation-Date: 2021-10-16 11:52+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=CHARSET\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#: test.cpp:60 +msgid "" +"De naam 'Omrop Fryslân' houdt in: Regionaal herkenbaar, actueel, " +"onafhankelijk, betrouwbaar, toegankelijk, vermakelijk en divers" +msgstr "" + +#: test.cpp:63 +msgid "I 💚 Fryslân" +msgstr "" + +#: test.cpp:58 +msgid "" +"Omrop Fryslân makket radio en telefyzje yn it Frysk, dêrmei is de omrop de " +"ienige stjoerder fan Nederlân dy’t net yn it Nederlânsk útstjoert" +msgstr "" + #. This is the first comment. -#: test.cpp:31 +#: test.cpp:71 msgctxt "TEST|String|1" msgid "String English" msgstr "" #. This is the second comment. -#: test.cpp:33 +#: test.cpp:73 msgctxt "TEST|String|2" msgid "String English" msgstr "" #. This is the third comment. -#: test.cpp:35 +#: test.cpp:75 msgctxt "TEST|String|3" msgid "String English" msgstr "" #. This is the first comment. -#: test.cpp:19 +#: test.cpp:46 msgid "String English One" msgstr "" #. This is the third comment. -#: test.cpp:23 +#: test.cpp:50 msgid "String English Three" msgstr "" #. This is the second comment. -#: test.cpp:21 +#: test.cpp:48 msgid "String English Two" msgstr "" + +#: test.cpp:62 +msgid "geändert ß" +msgstr ""