Sha256: b308f5d4da3af1fee1a5ea1fcb1165357f346bbb9178348a146623c83c8317b4
Contents?: true
Size: 896 Bytes
Versions: 17
Compression:
Stored size: 896 Bytes
Contents
var I18n = require("../../app/assets/javascripts/i18n") , Translations = require("./translations") ; describe("Interpolation", function(){ var actual, expected; beforeEach(function(){ I18n.reset(); I18n.translations = Translations(); }); it("performs single interpolation", function(){ actual = I18n.t("greetings.name", {name: "John Doe"}); expect(actual).toEqual("Hello John Doe!"); }); it("performs multiple interpolations", function(){ actual = I18n.t("profile.details", {name: "John Doe", age: 27}); expect(actual).toEqual("John Doe is 27-years old"); }); it("performs interpolation with the count option", function(){ expect(I18n.t("inbox", {count: 0})).toEqual("You have no messages"); expect(I18n.t("inbox", {count: 1})).toEqual("You have 1 message"); expect(I18n.t("inbox", {count: 5})).toEqual("You have 5 messages"); }); });
Version data entries
17 entries across 17 versions & 3 rubygems