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: 514d0d011935666b1e2a7455cd29df13f12b2cd2130cd9625349f9f9013198d3
4
- data.tar.gz: 637e017006a28f72e16a19a457f1760cae3c1a428a2f3e5efa0921fae2f1e7c5
3
+ metadata.gz: 2f5e9de641beaf943b18722eed062c46382496f9f072c1e5644b9305c5a6f076
4
+ data.tar.gz: 3613ed401f7300bcba2462c30622906bc1906d9d181cf0eb631b81b7fb8d7a05
5
5
  SHA512:
6
- metadata.gz: 272ae0fe075b3a4927806cc5ec1e28331673b35d652acb7af746964bbe844c7478b650d0468c1b6d16f0f65724faf4dad0de5707bf813703988e07e9e5a88708
7
- data.tar.gz: 07fefd534e3d8be9822c3a6f5d293deba54042af6f1744981e97fd245e6e399b6ccd3772c6efaef518da0d9144708ce318ec1ec67c83b99b65edc15ab777d01c
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
@@ -5,7 +5,7 @@
5
5
  <%= csrf_meta_tags %>
6
6
  <%= csp_meta_tag %>
7
7
 
8
- <%= stylesheet_link_tag "rosette/application", media: "all" %>
8
+ <%= stylesheet_link_tag "rosette/style", media: "all" %>
9
9
  </head>
10
10
  <body>
11
11
 
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 exit?
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. Help", "help")
35
- menu.choice("5. Exit", "exit")
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 help?
51
- command == "help"
52
- end
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 valid keys:
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
@@ -5,6 +5,10 @@ module Rosette
5
5
 
6
6
  isolate_namespace Rosette
7
7
 
8
+ initializer "rosette.assets.precompile" do |app|
9
+ app.config.assets.precompile += ["style.css"]
10
+ end
11
+
8
12
  config.after_initialize do |app|
9
13
  app.routes.prepend do
10
14
  mount Rosette::Engine, at: "/rosette"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rosette
4
4
 
5
- VERSION = "0.3.3"
5
+ VERSION = "0.3.5"
6
6
 
7
7
  end
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.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/application.css
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