From 1c4f09d4191999850c79197a20ac04b74bfb2f22 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 4 May 2015 00:21:02 +0200 Subject: [PATCH] Fixed locale detection, added tests. --- public/assets/tests/core.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/public/assets/tests/core.js b/public/assets/tests/core.js index 2fe4bc6fd..4378d5a07 100644 --- a/public/assets/tests/core.js +++ b/public/assets/tests/core.js @@ -280,6 +280,18 @@ test( "i18n", function() { timestamp = App.i18n.translateTimestamp('2012-11-06T21:07:24Z', offset); equal( timestamp, '11/06/2012 21:07', 'en - timestamp translated correctly' ); + + // locale alias test + // de + App.i18n.set('de'); + var translated = App.i18n.translateContent('yes'); + equal( translated, 'ja', 'de - yes / ja translated correctly' ); + + // locale detection test + // de-ch + App.i18n.set('de-ch'); + var translated = App.i18n.translateContent('yes'); + equal( translated, 'ja', 'de - yes / ja translated correctly' ); }); // events