i18n-translate-light 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19571f37a1015b35f94856992dc9a2fc277cec7f
4
- data.tar.gz: d5862112f2c93dc1a1f3d9162f9e068fce8a7fa7
3
+ metadata.gz: a4a2f4967fd89e395266ee6e2ae9e885423e929c
4
+ data.tar.gz: 3f73ab2f56c69a74c9d17a4c6d75cd38657b09a6
5
5
  SHA512:
6
- metadata.gz: 3cbf9498dd80814a1876b65e7b43ca9195a2d8b8fd11c55023341c758716509ee9b7f59ddb89ff4ab9ccd1375106ceebe8c1fefe18f563ce2ee9b021d9fb6011
7
- data.tar.gz: d520114cead2d96a95d24d51fe84f8014f5353d42b33e13415c8671f235eddf86a7df2847a71431600ab7490fe01db7f1ac6f74fbc1a7b42d0912839f006c4c7
6
+ metadata.gz: ad723bff0f94d209884a5a667ea0980b333101407dcd20d1cf6fa4602e7fd7912e0c78a02c8eb7fbc5bbda492c92db0fca8664c305a3e772a9d83f7d0c9e01ad
7
+ data.tar.gz: db735d3f2d3002c71a2497d7cc14f1d0cb65566b3f8ae0a105ceff32e16968f35f26ec80c9adad268cea8078c24a89c1306cdd56a13db0e695a3862e87340f69
@@ -1,6 +1,11 @@
1
1
  i18n-translate-light Changelog
2
2
  ==============================
3
3
 
4
+ # 0.0.4
5
+
6
+ * Feature: Adds `I18NTranslateLight.getLocale()` API
7
+
8
+
4
9
  # 0.0.3
5
10
 
6
11
  * Feature: Adds `I18NTranslateLight.userlocale` property
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- i18n-translate-light (0.0.3)
4
+ i18n-translate-light (0.0.4)
5
5
  railties (>= 3.1)
6
6
 
7
7
  GEM
@@ -13,6 +13,11 @@ var I18NTranslateLight = (function($) {
13
13
  this.activeLocales = expandLocales(locale);
14
14
  };
15
15
 
16
+ var getLocale = function(locale) {
17
+ // Return a copy of translations for this locale
18
+ return $.extend({}, this.dict[locale]);
19
+ };
20
+
16
21
  var autoDetectLocale = function() {
17
22
  var detectedLocale = detectBrowserLocale();
18
23
 
@@ -81,6 +86,7 @@ var I18NTranslateLight = (function($) {
81
86
  resetDict: function() { this.dict = {}; },
82
87
  detectBrowserLocale: detectBrowserLocale,
83
88
  setLocale: setLocale,
89
+ getLocale: getLocale,
84
90
  autoDetectLocale: autoDetectLocale,
85
91
  expandLocales: expandLocales,
86
92
  parseLocale: parseLocale,
@@ -13,6 +13,11 @@ var I18NTranslateLight = (function($) {
13
13
  this.activeLocales = expandLocales(locale);
14
14
  };
15
15
 
16
+ var getLocale = function(locale) {
17
+ // Return a copy of translations for this locale
18
+ return $.extend({}, this.dict[locale]);
19
+ };
20
+
16
21
  var autoDetectLocale = function() {
17
22
  var detectedLocale = detectBrowserLocale();
18
23
 
@@ -81,6 +86,7 @@ var I18NTranslateLight = (function($) {
81
86
  resetDict: function() { this.dict = {}; },
82
87
  detectBrowserLocale: detectBrowserLocale,
83
88
  setLocale: setLocale,
89
+ getLocale: getLocale,
84
90
  autoDetectLocale: autoDetectLocale,
85
91
  expandLocales: expandLocales,
86
92
  parseLocale: parseLocale,
@@ -1,7 +1,7 @@
1
1
  module I18N
2
2
  module Translate
3
3
  module Light
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
6
6
  end
7
7
  end
@@ -135,4 +135,17 @@ describe("I18NTranslateLight", function() {
135
135
  });
136
136
 
137
137
  });
138
+
139
+
140
+ describe("getLocale", function() {
141
+ it("should return locale dict", function() {
142
+ var expected = { 'oh': 'yeah '};
143
+ I18NTranslateLight.resetDict();
144
+ expect(I18NTranslateLight.dict).toEqual({});
145
+
146
+ I18NTranslateLight.addTranslations( 'en', expected );
147
+ expect(I18NTranslateLight.dict).toEqual({ 'en': expected });
148
+ });
149
+ });
150
+
138
151
  });
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.3
4
+ version: 0.0.4
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-07 00:00:00.000000000 Z
11
+ date: 2014-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.2.0.rc.1
114
+ rubygems_version: 2.2.2
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Light-weight I18N Translations