i18n-translate-light 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9406fbe782980d4f3825238f5271ce22f6ae0bdc
4
- data.tar.gz: 6f865acf50fc3b60ab71ce46e78d40d1ce248357
3
+ metadata.gz: 19571f37a1015b35f94856992dc9a2fc277cec7f
4
+ data.tar.gz: d5862112f2c93dc1a1f3d9162f9e068fce8a7fa7
5
5
  SHA512:
6
- metadata.gz: da84fe9457cf9ff122ee724bd4c58eb88f361bf42ffd17ea123339166c8d653420146d8cae60820a514e32bd3023b6c02e2569c24119175c6723937f23ffe21f
7
- data.tar.gz: fdf7fa70c240a0aed788c90cd6eda096500597fcaae0b39c9589cf607fe2edb50e4371f6fa735982e8fdb33c451362d00b739242215c5816ad699a9d4e339c43
6
+ metadata.gz: 3cbf9498dd80814a1876b65e7b43ca9195a2d8b8fd11c55023341c758716509ee9b7f59ddb89ff4ab9ccd1375106ceebe8c1fefe18f563ce2ee9b021d9fb6011
7
+ data.tar.gz: d520114cead2d96a95d24d51fe84f8014f5353d42b33e13415c8671f235eddf86a7df2847a71431600ab7490fe01db7f1ac6f74fbc1a7b42d0912839f006c4c7
data/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ i18n-translate-light Changelog
2
+ ==============================
3
+
4
+ # 0.0.3
5
+
6
+ * Feature: Adds `I18NTranslateLight.userlocale` property
7
+
8
+ # 0.0.2
9
+
10
+ * Fix: Gemspec, Bundler, and railstie dependency fix.
11
+
12
+ # 0.0.1
13
+
14
+ * Initial release
15
+ * Feature: Translation dictionary management
16
+ * Feature: Locale Detection
17
+ * Feature: Translation lookup
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- i18n-translate-light (0.0.2)
4
+ i18n-translate-light (0.0.3)
5
5
  railties (>= 3.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -43,6 +43,7 @@ Here are the following APIs for the I18NTranslateLight singleton:
43
43
  * `autoDetectLocale()` - Auto detect user locale from Browser settings, sets active locale.
44
44
  * `addTranslations(locale, locationHash)` - Add a translations for locale (eg: `en-US`) as a hash of key/string pairs (eg: `{ "ui.dialog.cancel": "Cancel" }`)
45
45
  * `translate(key)` / `_t(key)` - Return translated text for key
46
+ * `userLocale` - Return current user locale
46
47
 
47
48
  ## Installing
48
49
 
@@ -5,9 +5,11 @@
5
5
  var I18NTranslateLight = (function($) {
6
6
  this.dict = {};
7
7
  this.defaultLocale = 'en';
8
+ this.userLocale = this.defaultLocale;
8
9
  this.activeLocales = [ this.defaultLocale ];
9
10
 
10
11
  var setLocale = function(locale) {
12
+ this.userLocale = locale;
11
13
  this.activeLocales = expandLocales(locale);
12
14
  };
13
15
 
@@ -75,6 +77,7 @@ var I18NTranslateLight = (function($) {
75
77
  dict: this.dict,
76
78
  activeLocales: this.activeLocales,
77
79
  defaultLocale: this.defaultLocale,
80
+ userLocale: this.userLocale,
78
81
  resetDict: function() { this.dict = {}; },
79
82
  detectBrowserLocale: detectBrowserLocale,
80
83
  setLocale: setLocale,
@@ -5,9 +5,11 @@
5
5
  var I18NTranslateLight = (function($) {
6
6
  this.dict = {};
7
7
  this.defaultLocale = 'en';
8
+ this.userLocale = this.defaultLocale;
8
9
  this.activeLocales = [ this.defaultLocale ];
9
10
 
10
11
  var setLocale = function(locale) {
12
+ this.userLocale = locale;
11
13
  this.activeLocales = expandLocales(locale);
12
14
  };
13
15
 
@@ -75,6 +77,7 @@ var I18NTranslateLight = (function($) {
75
77
  dict: this.dict,
76
78
  activeLocales: this.activeLocales,
77
79
  defaultLocale: this.defaultLocale,
80
+ userLocale: this.userLocale,
78
81
  resetDict: function() { this.dict = {}; },
79
82
  detectBrowserLocale: detectBrowserLocale,
80
83
  setLocale: setLocale,
@@ -1,7 +1,7 @@
1
1
  module I18N
2
2
  module Translate
3
3
  module Light
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -94,6 +94,15 @@ describe("I18NTranslateLight", function() {
94
94
  I18NTranslateLight.setLocale('es-ES');
95
95
  expect(I18NTranslateLight.activeLocales).toEqual([ 'es-ES', 'es', 'en' ]);
96
96
  });
97
+
98
+ it("should set userLocale", function() {
99
+ I18NTranslateLight.setLocale('en');
100
+
101
+ expect(I18NTranslateLight.userLocale).toEqual('en');
102
+
103
+ I18NTranslateLight.setLocale('es-ES');
104
+ expect(I18NTranslateLight.userLocale).toEqual('es-ES');
105
+ });
97
106
  });
98
107
 
99
108
  describe("translate", function() {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-translate-light
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Winfield Peterson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-04 00:00:00.000000000 Z
11
+ date: 2014-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -75,6 +75,7 @@ extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
77
  - ".gitignore"
78
+ - CHANGELOG.md
78
79
  - Gemfile
79
80
  - Gemfile.lock
80
81
  - LICENSE.txt