i18n-translate-light 0.0.3 → 0.0.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4a2f4967fd89e395266ee6e2ae9e885423e929c
|
4
|
+
data.tar.gz: 3f73ab2f56c69a74c9d17a4c6d75cd38657b09a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad723bff0f94d209884a5a667ea0980b333101407dcd20d1cf6fa4602e7fd7912e0c78a02c8eb7fbc5bbda492c92db0fca8664c305a3e772a9d83f7d0c9e01ad
|
7
|
+
data.tar.gz: db735d3f2d3002c71a2497d7cc14f1d0cb65566b3f8ae0a105ceff32e16968f35f26ec80c9adad268cea8078c24a89c1306cdd56a13db0e695a3862e87340f69
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -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,
|
data/i18n-translate-light.js
CHANGED
@@ -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,
|
@@ -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.
|
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-
|
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.
|
114
|
+
rubygems_version: 2.2.2
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Light-weight I18N Translations
|