rosette 0.3.3 → 0.3.5
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f5e9de641beaf943b18722eed062c46382496f9f072c1e5644b9305c5a6f076
|
4
|
+
data.tar.gz: 3613ed401f7300bcba2462c30622906bc1906d9d181cf0eb631b81b7fb8d7a05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 380428feedbdc69a2454f891d1092be6e4246d29baee674693668b5fe76bf942d5c88ad6d3392204fc747e4524be4a401fa42d1a9c67bfb156f5c53cd6152783
|
7
|
+
data.tar.gz: 5600c9057b1f8bb73acf19d1e37919d6c36b6a45df493f23caa1dd1d636bf7db93f1c74fa3b87319264579b8d6f286ffc2c1c35a78ae61e3712a51eef8bd2676
|
data/README.md
CHANGED
@@ -23,6 +23,14 @@ Make sure your app raises error for missing translations in development:
|
|
23
23
|
config.i18n.raise_on_missing_translations = true
|
24
24
|
```
|
25
25
|
|
26
|
+
and that you explicitly set the available locales:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
# config/application.rb
|
30
|
+
|
31
|
+
config.i18n.available_locales = [:fr, :en]
|
32
|
+
```
|
33
|
+
|
26
34
|
Whether you currently use or are interested in starting to use [i18n-task to normalize](https://github.com/glebm/i18n-tasks#normalize-data) your locales files, add this initializer:
|
27
35
|
|
28
36
|
```ruby
|
data/lib/rosette/cli.rb
CHANGED
@@ -14,9 +14,10 @@ module Rosette
|
|
14
14
|
def run
|
15
15
|
loop do
|
16
16
|
ask_for_command
|
17
|
-
return if
|
17
|
+
return exit 0 if exit_cli?
|
18
18
|
|
19
19
|
next display_help if help?
|
20
|
+
next normalize! if normalize?
|
20
21
|
|
21
22
|
ask_for_key
|
22
23
|
send command
|
@@ -31,8 +32,9 @@ module Rosette
|
|
31
32
|
menu.choice("1. Read a translation", "read")
|
32
33
|
menu.choice("2. Add a translation", "add")
|
33
34
|
menu.choice("3. Remove a translation", "remove")
|
34
|
-
menu.choice("4.
|
35
|
-
menu.choice("5.
|
35
|
+
menu.choice("4. Normalize locales", "normalize")
|
36
|
+
menu.choice("5. Help", "help")
|
37
|
+
menu.choice("6. Exit", "exit_cli")
|
36
38
|
end
|
37
39
|
end
|
38
40
|
|
@@ -47,13 +49,9 @@ module Rosette
|
|
47
49
|
end
|
48
50
|
end
|
49
51
|
|
50
|
-
def
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
def exit?
|
55
|
-
command == "exit"
|
56
|
-
end
|
52
|
+
def exit_cli? = command == "exit_cli"
|
53
|
+
def help? = command == "help"
|
54
|
+
def normalize? = command == "normalize"
|
57
55
|
|
58
56
|
# COMMANDS
|
59
57
|
|
@@ -77,11 +75,15 @@ module Rosette
|
|
77
75
|
end
|
78
76
|
end
|
79
77
|
|
78
|
+
def normalize!
|
79
|
+
Manager.normalize!
|
80
|
+
end
|
81
|
+
|
80
82
|
def display_help
|
81
83
|
puts <<~HELP
|
82
84
|
|
83
85
|
For commands read/add/remove you must provide a key pointing to the translation.
|
84
|
-
It can begin with or without the locale. These are all
|
86
|
+
It can begin with or without the locale. These keys are all considered equivalent:
|
85
87
|
|
86
88
|
fr.activemodel.errors.blank
|
87
89
|
en.activemodel.errors.blank
|
data/lib/rosette/engine.rb
CHANGED
data/lib/rosette/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rosette
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre Platteeuw
|
@@ -78,7 +78,7 @@ files:
|
|
78
78
|
- README.md
|
79
79
|
- Rakefile
|
80
80
|
- app/assets/config/rosette_manifest.js
|
81
|
-
- app/assets/stylesheets/rosette/
|
81
|
+
- app/assets/stylesheets/rosette/style.css
|
82
82
|
- app/controllers/rosette/application_controller.rb
|
83
83
|
- app/controllers/rosette/translations_controller.rb
|
84
84
|
- app/helpers/rosette/application_helper.rb
|
File without changes
|