Code coverage report for .readme/includes/I18N/I18NStringDocExample.js

Statements: 100% (7 / 7)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (7 / 7)      Ignored: none     

All files » .readme/includes/I18N/ » I18NStringDocExample.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  1     1         1     1 1       1 1  
 
var I18NString = Divhide.I18N.String;
 
/// the external translation data
var Portuguese = {
    "hello <%= username %>": "olá <%= username %>"
};
 
/// create a I18NString (message + data)
var message = new I18NString("hello <%= username %>", { username: "oscar" });
 
/// Gets the English message
var en = message.toString();
expect(en)
    .toBe("hello oscar");
 
/// Gets the Portuguese message
var en = message.toString(Portuguese);
expect(en)
    .toBe("olá oscar");