mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure client-side translations are correctly extracted into the message templates.
This commit is contained in:
@@ -7,20 +7,20 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
define(["sources/translate", "translations"], function (translate, translations) {
|
||||
define(["sources/gettext", "translations"], function (gettext, translations) {
|
||||
describe("translate", function () {
|
||||
describe("when there is no translation", function () {
|
||||
it("returns the original string", function () {
|
||||
expect(translate("something to be translated")).toEqual("something to be translated");
|
||||
expect(gettext("something to be translated")).toEqual("something to be translated");
|
||||
});
|
||||
|
||||
describe("when there are substitutions", function () {
|
||||
it("interpolates a substitution", function () {
|
||||
expect(translate("translate text for %(person)s", {"person": "Sarah"})).toEqual("translate text for Sarah")
|
||||
expect(gettext("translate text for %(person)s", {"person": "Sarah"})).toEqual("translate text for Sarah")
|
||||
});
|
||||
|
||||
it("interpolates multiple substitutions", function () {
|
||||
expect(translate("translate '%(text)s' for %(person)s",
|
||||
expect(gettext("translate '%(text)s' for %(person)s",
|
||||
{
|
||||
"text": "constitution",
|
||||
"person": "Sarah"
|
||||
@@ -38,12 +38,12 @@ define(["sources/translate", "translations"], function (translate, translations)
|
||||
});
|
||||
|
||||
it("returns the translation", function () {
|
||||
expect(translate("something to be translated")).toEqual("etwas zum uebersetzen");
|
||||
expect(gettext("something to be translated")).toEqual("etwas zum uebersetzen");
|
||||
});
|
||||
|
||||
describe("when there is a substitution", function () {
|
||||
it("interpolates the substitution", function () {
|
||||
expect(translate("another translation for %(person)s", {"person": "Sarah"}))
|
||||
expect(gettext("another translation for %(person)s", {"person": "Sarah"}))
|
||||
.toEqual("eine weitere Uebersetzung fuer Sarah");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user