Skip to content

Commit

Permalink
Merge pull request #25 from funktionswerk/handlebars-prepared-stateme…
Browse files Browse the repository at this point in the history
…nt-testcase

Handlebars prepared statement testcase
  • Loading branch information
kaywolter committed Jun 4, 2019
2 parents f6d5b4c + 9fa7fa2 commit 9a16d47
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hapi-i18n",
"version": "2.1.0",
"version": "2.1.1",
"description": "Translation module for hapi based on mashpie's i18n module",
"main": "index.js",
"directories": {
Expand Down
3 changes: 2 additions & 1 deletion test/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"one": "%s bouteille de bière sur le mur.",
"other": "%s bouteilles de bière sur le mur."
},
"": ""
"": "",
"Current languageCode: <strong>%s</strong>": "Langue courante: <strong>%s</strong>"
}
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ describe('Localization', function () {
}
);
response.statusCode.should.equal(200);
response.result.should.equal('<!DOCTYPE html><html lang=fr><body><p>Tout est bien qui finit bien.</p><p>99 bouteilles de bière sur le mur.</p></body></html>\n');
response.result.should.equal('<!DOCTYPE html><html lang=fr><body><p>Tout est bien qui finit bien.</p><p>99 bouteilles de bière sur le mur.</p><p>Langue courante: <strong>fr</strong></p></body></html>\n');
});

it('returns status code NOT-FOUND if the requested locale is not available', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/views/test.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang={{languageCode}}><body><p>{{#i18n message}}{{/i18n}}</p><p>{{song}}</p></body></html>
<!DOCTYPE html><html lang={{languageCode}}><body><p>{{#i18n message}}{{/i18n}}</p><p>{{song}}</p><p>{{{__mf "Current languageCode: <strong>%s</strong>" languageCode}}}</p></body></html>

0 comments on commit 9a16d47

Please sign in to comment.