gettext_simple 0.0.0 → 0.0.1

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: fc52a6c77d98ee197e4ec2a6fb94f16f1d05b9ac
4
- data.tar.gz: eabbfcbb9bf2c5508a669b87a8ec4d0c8d2a71c5
3
+ metadata.gz: a384e7b157443ea0777813008727f62246b5d596
4
+ data.tar.gz: 550b003e7b7bf80c8f50b204d2e8f53f1fdb33f3
5
5
  SHA512:
6
- metadata.gz: 59b717d2a852942698df7333b32916928dfd750bbb640c7eabaae016042ad2a1dc7cfc2cdea3702d23dd99abb77b19bb65db9fd0a7684cfc462dbd0d44b3dc08
7
- data.tar.gz: 1802f0f9558e44fac5e814948ab45e654b557b67fc46095aa88bfe5d552a3cd5e32b8ee58e36df5f00ac61dd260ace1ff9c359a8c8c772041bd4d377ba7bbea7
6
+ metadata.gz: 16164102cf9c4d8e282979153b81cf903d67ab49242052387f42c678a21d312d9cc9be481851aac7978fd0f7981c189c1917bfd628b9b63a98434e91dd4b577e
7
+ data.tar.gz: a7a6624968f33de23ae65962b808abd8ddc8f7d1afa2c964c2b99de33972c91dddfd91ab1b68db2b1b28e762b020716cdd32847e129898e2c7a3f1d11ca75185
data/README.rdoc CHANGED
@@ -1,6 +1,21 @@
1
1
  = gettext_simple
2
2
 
3
- Description goes here.
3
+ A very simple implementation of Gettext for Ruby.
4
+
5
+ This is how it could be initialized in Rails and take the locale from I18n.locale:
6
+ ```ruby
7
+ require "gettext_simple"
8
+ gettext_simple = GettextSimple.new(:i18n => true)
9
+ gettext_simple.load_dir("#{__dir__}/../../locales_gettext")
10
+ gettext_simple.register_kernel_methods
11
+
12
+ echo _("Hello world")
13
+ ```
14
+
15
+ Replacements are done this way:
16
+ ```ruby
17
+ echo _("Hello %{name}", :name => "Kasper") #=> "Hello Kasper"
18
+ ```
4
19
 
5
20
  == Contributing to gettext_simple
6
21
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gettext_simple"
8
- s.version = "0.0.0"
8
+ s.version = "0.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
@@ -13,7 +13,7 @@ class GettextSimple
13
13
  @i18n = @args[:i18n]
14
14
 
15
15
  if @i18n
16
- @default_locale = @i18n.default_locale
16
+ @default_locale = I18n.default_locale
17
17
  else
18
18
  @default_locale = @args[:default_locale]
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gettext_simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Johansen