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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e552b7591689b58ea307aea380fc61234dc7f30f
4
- data.tar.gz: 2b54299e187617458e5bb5cab7ffaa827cff36fd
3
+ metadata.gz: 43b87ab12cb0f0031b5308f2a7ffe7dd5fe43d7f
4
+ data.tar.gz: 284074d12564decc774f48b1169d9814e66459ec
5
5
  SHA512:
6
- metadata.gz: f4ab00730f663372e507f0609a27330c493d383983400678f638087214acb870fc117551799e8ae2abe8431d44b7fe8836290259d92771b854a83b5388e2645e
7
- data.tar.gz: c2438118fe9d793939e04b0f7fb613e5cd04c6af94f50519bf3ec23dba02fa5f2cd0e2819a261e5c85be203d669ab5573756b18e234fa0454d86ee6faf2c29ab
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
@@ -1,3 +1,3 @@
1
1
  module U10d
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
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
@@ -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
- it: "italiano"
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.1.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-09 00:00:00.000000000 Z
11
+ date: 2017-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n