mirror of https://github.com/kiwix/libkiwix.git
Introduced a fake language for i18n testing
We need a fake language for tests that won't be affected by modifications made by 3rd party translators (see kiwix/libkiwix#749). - static/i18n/hy.json was cloned as static/i18n/test.json - usage of "hy" in unit-tests was replaced with "test"
This commit is contained in:
parent
3568ccd511
commit
956289d9f8
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"@metadata": {
|
||||||
|
"authors": [
|
||||||
|
"Kareyac"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"name": "Հայերեն",
|
||||||
|
"suggest-full-text-search": "որոնել '{{{SEARCH_TERMS}}}'...",
|
||||||
|
"no-such-book": "Գիրքը բացակայում է՝ {{BOOK_NAME}}",
|
||||||
|
"url-not-found": "Սխալ հասցե՝ {{url}}",
|
||||||
|
"suggest-search": "Որոնել <a href=\"{{{SEARCH_URL}}}\">{{PATTERN}}</a>",
|
||||||
|
"400-page-title": "Անվավեր հարցում",
|
||||||
|
"400-page-heading": "Անվավեր հարցում",
|
||||||
|
"404-page-title": "Սխալ հասցե",
|
||||||
|
"404-page-heading": "Սխալ հասցե",
|
||||||
|
"library-button-text": "Գրադարանի էջ",
|
||||||
|
"home-button-text": "Դեպի '{{BOOK_TITLE}}'֊ի գլխավոր էջը",
|
||||||
|
"random-page-button-text": "Բացել պատահական էջ",
|
||||||
|
"searchbox-tooltip": "Որոնել '{{BOOK_TITLE}}'֊ում"
|
||||||
|
}
|
|
@ -16,6 +16,7 @@ i18n/ru.json
|
||||||
i18n/sc.json
|
i18n/sc.json
|
||||||
i18n/sk.json
|
i18n/sk.json
|
||||||
i18n/sv.json
|
i18n/sv.json
|
||||||
|
i18n/test.json
|
||||||
i18n/tr.json
|
i18n/tr.json
|
||||||
i18n/zh-hans.json
|
i18n/zh-hans.json
|
||||||
i18n/zh-hant.json
|
i18n/zh-hant.json
|
||||||
|
|
|
@ -611,7 +611,7 @@ TEST_F(ServerTest, Http404HtmlError)
|
||||||
</p>
|
</p>
|
||||||
)" },
|
)" },
|
||||||
|
|
||||||
{ /* url */ "/ROOT/random?content=non-existent-book&userlang=hy",
|
{ /* url */ "/ROOT/random?content=non-existent-book&userlang=test",
|
||||||
expected_page_title=="Սխալ հասցե" &&
|
expected_page_title=="Սխալ հասցե" &&
|
||||||
expected_body==R"(
|
expected_body==R"(
|
||||||
<h1>Սխալ հասցե</h1>
|
<h1>Սխալ հասցե</h1>
|
||||||
|
@ -636,7 +636,7 @@ TEST_F(ServerTest, Http404HtmlError)
|
||||||
</p>
|
</p>
|
||||||
)" },
|
)" },
|
||||||
|
|
||||||
{ /* url */ "/ROOT/catalog/?userlang=hy",
|
{ /* url */ "/ROOT/catalog/?userlang=test",
|
||||||
expected_page_title=="Սխալ հասցե" &&
|
expected_page_title=="Սխալ հասցե" &&
|
||||||
expected_body==R"(
|
expected_body==R"(
|
||||||
<h1>Սխալ հասցե</h1>
|
<h1>Սխալ հասցե</h1>
|
||||||
|
@ -653,7 +653,7 @@ TEST_F(ServerTest, Http404HtmlError)
|
||||||
</p>
|
</p>
|
||||||
)" },
|
)" },
|
||||||
|
|
||||||
{ /* url */ "/ROOT/catalog/invalid_endpoint?userlang=hy",
|
{ /* url */ "/ROOT/catalog/invalid_endpoint?userlang=test",
|
||||||
expected_page_title=="Սխալ հասցե" &&
|
expected_page_title=="Սխալ հասցե" &&
|
||||||
expected_body==R"(
|
expected_body==R"(
|
||||||
<h1>Սխալ հասցե</h1>
|
<h1>Սխալ հասցե</h1>
|
||||||
|
@ -710,7 +710,7 @@ TEST_F(ServerTest, Http404HtmlError)
|
||||||
</p>
|
</p>
|
||||||
)" },
|
)" },
|
||||||
|
|
||||||
{ /* url */ "/ROOT/content/zimfile/invalid-article?userlang=hy",
|
{ /* url */ "/ROOT/content/zimfile/invalid-article?userlang=test",
|
||||||
expected_page_title=="Սխալ հասցե" &&
|
expected_page_title=="Սխալ հասցե" &&
|
||||||
book_name=="zimfile" &&
|
book_name=="zimfile" &&
|
||||||
book_title=="Ray Charles" &&
|
book_title=="Ray Charles" &&
|
||||||
|
@ -1001,7 +1001,7 @@ TEST_F(ServerTest, UserLanguageControl)
|
||||||
/* expected <h1> */ "Not Found"
|
/* expected <h1> */ "Not Found"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
/*url*/ "/ROOT/content/zimfile/invalid-article?userlang=hy",
|
/*url*/ "/ROOT/content/zimfile/invalid-article?userlang=test",
|
||||||
/*Accept-Language:*/ "",
|
/*Accept-Language:*/ "",
|
||||||
/* expected <h1> */ "Սխալ հասցե"
|
/* expected <h1> */ "Սխալ հասցե"
|
||||||
},
|
},
|
||||||
|
@ -1012,13 +1012,13 @@ TEST_F(ServerTest, UserLanguageControl)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
/*url*/ "/ROOT/content/zimfile/invalid-article",
|
/*url*/ "/ROOT/content/zimfile/invalid-article",
|
||||||
/*Accept-Language:*/ "hy",
|
/*Accept-Language:*/ "test",
|
||||||
/* expected <h1> */ "Սխալ հասցե"
|
/* expected <h1> */ "Սխալ հասցե"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// userlang query parameter takes precedence over Accept-Language
|
// userlang query parameter takes precedence over Accept-Language
|
||||||
/*url*/ "/ROOT/content/zimfile/invalid-article?userlang=en",
|
/*url*/ "/ROOT/content/zimfile/invalid-article?userlang=en",
|
||||||
/*Accept-Language:*/ "hy",
|
/*Accept-Language:*/ "test",
|
||||||
/* expected <h1> */ "Not Found"
|
/* expected <h1> */ "Not Found"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1026,7 +1026,7 @@ TEST_F(ServerTest, UserLanguageControl)
|
||||||
// In case of a comma separated list of languages (optionally weighted
|
// In case of a comma separated list of languages (optionally weighted
|
||||||
// with quality values) the default (en) language is used instead.
|
// with quality values) the default (en) language is used instead.
|
||||||
/*url*/ "/ROOT/content/zimfile/invalid-article",
|
/*url*/ "/ROOT/content/zimfile/invalid-article",
|
||||||
/*Accept-Language:*/ "hy;q=0.9, en;q=0.2",
|
/*Accept-Language:*/ "test;q=0.9, en;q=0.2",
|
||||||
/* expected <h1> */ "Not Found"
|
/* expected <h1> */ "Not Found"
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -1542,7 +1542,7 @@ R"EXPECTEDRESPONSE([
|
||||||
]
|
]
|
||||||
)EXPECTEDRESPONSE"
|
)EXPECTEDRESPONSE"
|
||||||
},
|
},
|
||||||
{ /* url: */ "/ROOT/suggest?content=zimfile&term=abracadabra&userlang=hy",
|
{ /* url: */ "/ROOT/suggest?content=zimfile&term=abracadabra&userlang=test",
|
||||||
R"EXPECTEDRESPONSE([
|
R"EXPECTEDRESPONSE([
|
||||||
{
|
{
|
||||||
"value" : "abracadabra ",
|
"value" : "abracadabra ",
|
||||||
|
|
Loading…
Reference in New Issue