i18n_screwdriver 10.4.0 → 10.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascrips/i18n_screwdriver/config.js +5 -0
- data/app/assets/javascrips/i18n_screwdriver/screw.js +13 -0
- data/lib/i18n_screwdriver/version.rb +1 -1
- metadata +3 -3
- data/app/assets/javascrips/i18n_screwdriver/config.coffee +0 -3
- data/app/assets/javascrips/i18n_screwdriver/screw.coffee +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e516acf75a0c358ecb8e44259212d6c087b8658441a7d8f75d9120587225fc06
|
4
|
+
data.tar.gz: ba1062edcb8289196912a3e0208d6587561f75bbf688cd02eda6e52b352e1e74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5daec9475659b384b3526e29291bb3df3e40df601f6ee35595249defa6531edb276cf9fbfaa56fbfcb85d50d4b57cc32ffbe6e9089d950fb1c9b213f2089a3e0
|
7
|
+
data.tar.gz: db8f74bbd26f5c5da0c5bc2d3d3639ae151ee3296f31e891ca45052b6803b45d6416f6b93ee58149828a8895ecb1203df35991a368a15da9fc235638920fd29e
|
@@ -0,0 +1,13 @@
|
|
1
|
+
//= require i18n_screwdriver/md5
|
2
|
+
|
3
|
+
const interpolate = (message, data) =>
|
4
|
+
message.replace(/%{([^{}]*)}/g, (a, b) => data[b]);
|
5
|
+
|
6
|
+
I18n.screw = function(message, data) {
|
7
|
+
const md5 = window.md5(message);
|
8
|
+
let translation = I18n.translations[I18n.locale][md5];
|
9
|
+
if (translation == null) {
|
10
|
+
translation = I18n.onMissingTranslation(md5, message);
|
11
|
+
}
|
12
|
+
return interpolate(translation, data);
|
13
|
+
};
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n_screwdriver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 10.
|
4
|
+
version: 10.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Miesel
|
@@ -69,9 +69,9 @@ files:
|
|
69
69
|
- LICENSE.txt
|
70
70
|
- README.rdoc
|
71
71
|
- Rakefile
|
72
|
-
- app/assets/javascrips/i18n_screwdriver/config.
|
72
|
+
- app/assets/javascrips/i18n_screwdriver/config.js
|
73
73
|
- app/assets/javascrips/i18n_screwdriver/md5.js
|
74
|
-
- app/assets/javascrips/i18n_screwdriver/screw.
|
74
|
+
- app/assets/javascrips/i18n_screwdriver/screw.js
|
75
75
|
- docker-compose.yml
|
76
76
|
- i18n_screwdriver.gemspec
|
77
77
|
- lib/i18n_screwdriver.rb
|
@@ -1,10 +0,0 @@
|
|
1
|
-
#= require i18n_screwdriver/md5
|
2
|
-
|
3
|
-
interpolate = (message, data) ->
|
4
|
-
message.replace(/%{([^{}]*)}/g, (a, b) -> data[b])
|
5
|
-
|
6
|
-
I18n.screw = (message, data) ->
|
7
|
-
md5 = window.md5(message)
|
8
|
-
translation = I18n.translations[I18n.locale][md5]
|
9
|
-
translation ?= I18n.onMissingTranslation(md5, message)
|
10
|
-
interpolate(translation, data)
|