Fix translation extraction for new client side translations, and update catalogs.

This commit is contained in:
Sarah McAlear
2017-03-28 15:21:49 -04:00
committed by Dave Page
parent 8745417926
commit 1d27341e21
17 changed files with 834 additions and 526 deletions

View File

@@ -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");
});
});