u10d 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -2
- data/lib/u10d/version.rb +1 -1
- data/lib/u10d.rb +8 -1
- data/locales/untranslated.rb +10 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43b87ab12cb0f0031b5308f2a7ffe7dd5fe43d7f
|
4
|
+
data.tar.gz: 284074d12564decc774f48b1169d9814e66459ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05c46c4006029b91746e307e050edc1dc90df0e7a7c193443be0ddcb8ba0d324247ae875703de3fc0f7ebd2b256b7a0f1ba257166d339e9b97a8c7dfa2af4fd9
|
7
|
+
data.tar.gz: 8988ceb345eb3e9109da1b7e378ffe94792000b5b91bd88a34c0f83f082789f16202f3c60e4563c78d233571c808cd68563e0f7b3360e4d71e4f487f14f337ba
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# U10d
|
1
|
+
# U10d - Untranslated language names
|
2
2
|
|
3
3
|
In multilingual user interfaces, it is common to present choices as language
|
4
4
|
names.
|
@@ -16,8 +16,18 @@ gem "u10d"
|
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
19
|
+
Autoglottonyms are created on-the-fly, based on your `available_locales`:
|
20
|
+
|
19
21
|
```ruby
|
20
|
-
require "u10d"
|
22
|
+
main> require "u10d"
|
23
|
+
main> I18n.available_locales = [:ru, :en]
|
24
|
+
main> U10d.activate!
|
25
|
+
main> I18n.locale = :en
|
26
|
+
main> I18n.t("untranslated.language.by_code.ru")
|
27
|
+
=> "русский"
|
28
|
+
main> I18n.locale = :ru
|
29
|
+
main> I18n.t("untranslated.language.by_code.ru")
|
30
|
+
=> "русский"
|
21
31
|
```
|
22
32
|
|
23
33
|
## Contributing
|
data/lib/u10d/version.rb
CHANGED
data/lib/u10d.rb
CHANGED
@@ -2,5 +2,12 @@ require "u10d/version"
|
|
2
2
|
require "i18n"
|
3
3
|
|
4
4
|
module U10d
|
5
|
-
KNOWN_LANGUAGES = %i(ar de en es fr it)
|
5
|
+
KNOWN_LANGUAGES = %i(ar de en es fr hu it ml pt ro ru zh)
|
6
|
+
|
7
|
+
def self.activate!
|
8
|
+
root_path = File.expand_path("..", __dir__)
|
9
|
+
I18n.load_path ||= []
|
10
|
+
I18n.load_path += [File.join(root_path, "locales", "untranslated.rb")]
|
11
|
+
I18n.reload!
|
12
|
+
end
|
6
13
|
end
|
data/locales/untranslated.rb
CHANGED
@@ -9,10 +9,17 @@ I18n.available_locales.reduce({}) do |a, locale|
|
|
9
9
|
en: "English",
|
10
10
|
es: "español",
|
11
11
|
fr: "français",
|
12
|
-
|
12
|
+
hu: "magyar",
|
13
|
+
it: "italiano",
|
14
|
+
ml: "മലയാളം",
|
15
|
+
pt: "Português",
|
16
|
+
ro: "română",
|
17
|
+
ru: "русский",
|
18
|
+
uk: "український",
|
19
|
+
zh: "中文"
|
13
20
|
}
|
14
|
-
}
|
15
|
-
}
|
21
|
+
}
|
22
|
+
}
|
16
23
|
}
|
17
24
|
a
|
18
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: u10d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Yates
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|