i18n-bamboo 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +46 -2
- data/i18n-bamboo.gemspec +2 -0
- data/lib/i18n/bamboo/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cfd6e263d8c6757068d359b5051c93e90a6ceb2
|
4
|
+
data.tar.gz: 3e625ee1a048a3da2a172f16b136837ea6ad4eab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48ae9eaca6ebcfa6145edf982ba192a658028d27fadf28c54508698b0a4cc20646f468d4be670326ca6a9118ce370f9fa9598a432973be30e8e3fc49cc156208
|
7
|
+
data.tar.gz: 53313d4621b421ec4557d2842cbb85ebba71afb1375ec443af0eaa151d14e8a0b8f8a38f8719872a82383e4bf86687f83685d2f19ffeb946c0161d0faa06406a
|
data/README.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
|
1
|
+
I18n::Bamboo
|
2
|
+
------------
|
3
|
+
|
4
|
+
[![Build Status](https://travis-ci.org/tcdowney/i18n-bamboo.svg?branch=master)](https://travis-ci.org/tcdowney/i18n-bamboo)
|
2
5
|
|
3
6
|
Consider the noble bamboo. This peculiar member of the Poaceae family has been known to grow to extraordinary lengths without yielding to (mostly) any obstacles.
|
4
7
|
|
@@ -6,6 +9,47 @@ Not unlike bamboo, the i18n translations of a Rails app will continue to grow.
|
|
6
9
|
|
7
10
|
I18n:Bamboo monkey patches the Rails I18n module and will force all calls to I18n.translate (I18n.t) and I18n.localize (I18n.l) to return the longest translated or localized value from all available locales. For obvious reasons (monkey patching :cold_sweat:), this gem is intended to be used for development purposes only to aid in UI and internationalization/localization testing.
|
8
11
|
|
12
|
+
## tl;dr
|
13
|
+
|
14
|
+
This gem monkey patches the I18n module to force I18n.translate and I18n.localize to always return the longest translation, regardless of current locale.
|
15
|
+
|
16
|
+
I18n-bamboo will help you find UI pain points and help you uncover some of the less responsive parts of your application.
|
17
|
+
|
18
|
+
## Example Usage
|
19
|
+
|
20
|
+
Consider the following hypothetical locale files:
|
21
|
+
```yml
|
22
|
+
# en.yml
|
23
|
+
en:
|
24
|
+
car: "Car"
|
25
|
+
dog: "Dog"
|
26
|
+
bird: "Feathered Friend"
|
27
|
+
|
28
|
+
# es.yml
|
29
|
+
es:
|
30
|
+
car: "Coche"
|
31
|
+
dog: "Perro"
|
32
|
+
bird: "Pajaro"
|
33
|
+
|
34
|
+
# de.yml
|
35
|
+
de:
|
36
|
+
car: "Automobil"
|
37
|
+
dog: "Hund"
|
38
|
+
bird: "Vogel"
|
39
|
+
```
|
40
|
+
|
41
|
+
Calls to the new monkey patched translation helper would return the following:
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
# Assume that I18n.default_locale = :en
|
45
|
+
I18n.t('car')
|
46
|
+
# => "Automobil"
|
47
|
+
I18n.t('dog')
|
48
|
+
# => "Perro"
|
49
|
+
I18n.t('bird')
|
50
|
+
# => "Feathered Friend"
|
51
|
+
```
|
52
|
+
|
9
53
|
## Installation
|
10
54
|
|
11
55
|
Add this line to your application's Gemfile:
|
@@ -20,7 +64,7 @@ Or install it yourself as:
|
|
20
64
|
|
21
65
|
$ gem install i18n-bamboo
|
22
66
|
|
23
|
-
##
|
67
|
+
## Configuration
|
24
68
|
### Automatic
|
25
69
|
Simply add the following line to your `config/environments/development.rb` file:
|
26
70
|
```ruby
|
data/i18n-bamboo.gemspec
CHANGED
@@ -33,6 +33,8 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
34
34
|
spec.require_paths = ['lib']
|
35
35
|
|
36
|
+
spec.required_ruby_version = '>= 1.9'
|
37
|
+
|
36
38
|
spec.add_dependency 'i18n'
|
37
39
|
|
38
40
|
spec.add_development_dependency 'bundler', '~> 1.6'
|
data/lib/i18n/bamboo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-bamboo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Downey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -135,7 +135,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
138
|
+
version: '1.9'
|
139
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
141
|
- - ">="
|