From 966cbd4cf8d795b1706ff400f604c6002d7e81f9 Mon Sep 17 00:00:00 2001 From: Di Peng Date: Fri, 29 Jul 2011 14:22:37 -0700 Subject: feat(i18n): collect and convert locale info from closure - add i18n/closure directory with closure i18n files and update-closure.sh script to update them - generate.sh script runs node.js scripts that extract localization rules from the closure library, transform them to a more suitable format and dumps them into i18n/locale directory as angular's $locale services - update Rakefile to copy i18n files to build/ and pkg/ dirs - copy i18n stuff during rake build - e2e tests for several locales --- i18n/spec/utilSpec.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 i18n/spec/utilSpec.js (limited to 'i18n/spec/utilSpec.js') diff --git a/i18n/spec/utilSpec.js b/i18n/spec/utilSpec.js new file mode 100644 index 00000000..e6304254 --- /dev/null +++ b/i18n/spec/utilSpec.js @@ -0,0 +1,14 @@ +var util = require('../src/util.js'); + +describe('findLocaleId', function() { + it('should find localeId', function() { + expect(util.findLocaleId('', 'num')).toBeUndefined(); + expect(util.findLocaleId('aa', 'datetime')).toBeUndefined(); + expect(util.findLocaleId('aa', 'randomType')).toBeUndefined(); + expect(util.findLocaleId('NumberFormatSymbols_en', 'datetime')).toBeUndefined(); + expect(util.findLocaleId('DateTimeSymbols_en', 'num')).toBeUndefined(); + + expect(util.findLocaleId('DateTimeSymbols_en', 'datetime')).toBe('en'); + expect(util.findLocaleId('NumberFormatSymbols_en_US', 'num')).toBe('en_US'); + }); +}); -- cgit v1.2.3