rails_codebook 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/rails_codebook/engine.rb +7 -1
- data/lib/rails_codebook/version.rb +1 -1
- 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: 1088737e513744d95f3ed8986a8ce1f57e60b08f
|
|
4
|
+
data.tar.gz: d111b2e09981fd1227415aa74c9f0757c05398a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b0173f94ad22220a5a5d5c372e2784dcb0305838c701e18f2d57001b21eee15675ec36a095460e6b6001ac50a66ac01920d1f0dad58cf717b86e6bbb565cfed2
|
|
7
|
+
data.tar.gz: 8a0dd95fbad1d7079988ef65888405712098a5497d550a6f759da30c1e1043c35325fc5999ae327ec5c9e6b79b4f64b8e599f1d5e22886b8a844b0fed2f64a4f
|
data/README.md
CHANGED
|
@@ -267,8 +267,9 @@ Therefore you got to have your translations for every codebook value you want to
|
|
|
267
267
|
I myself use the initializzation process like this:
|
|
268
268
|
|
|
269
269
|
in ```config/locales``` I created myself the ```codebooks``` directory where I placed all the files with different translations of codebook values in certain format:
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
|
|
271
|
+
_config/locales/codebook/cs.yml_
|
|
272
|
+
``` yaml
|
|
272
273
|
cs:
|
|
273
274
|
codebook: # this is the cb_key you can define in config block in case you dont like my default
|
|
274
275
|
boolean: # this is the codebook name
|
|
@@ -4,7 +4,13 @@ module RailsCodebook
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def initialize_content
|
|
7
|
-
|
|
7
|
+
routes = ['']
|
|
8
|
+
if File.exists?(File.join(Gem.loaded_specs['rails_codebook'].full_gem_path, 'config', 'locales', 'cs.yml'))
|
|
9
|
+
default_cb_route = [File.join(Gem.loaded_specs['rails_codebook'].full_gem_path, 'config', 'locales', 'cs.yml')]
|
|
10
|
+
routes = RailsCodebook::configuration.cb_data_path + default_cb_route
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
routes.each do |filename|
|
|
8
14
|
|
|
9
15
|
codebook_values_file = (File.exists?(filename)) ? filename : nil
|
|
10
16
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_codebook
|
|
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
|
- redrick
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-
|
|
11
|
+
date: 2013-12-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: redis
|