rails_i18n_manager 1.0.1 → 1.0.3

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: dd793986118b3f29a0c7c135dd7ec8441203113c4c1873cad805ad2eb4b245a3
4
- data.tar.gz: 909c10ed34654f3f6f759f2b36a9272689a50806d449bc50afa3a28934293f05
3
+ metadata.gz: b8f237f3945385f864800ae205e29a56db0968035bf0121e0efbf24e890b924b
4
+ data.tar.gz: c000f125974eb73ecadde8ef9d14e6dcc9bb031145d1c693e02dc60c9d564fdb
5
5
  SHA512:
6
- metadata.gz: 4f557ff74d5d911fc1fdbb1be32c70e685fd89716f6a4026d86f32c1d8d12378357ccc39124131dd273baf31e13c2bd926a19923a6dffbf37e2fde48776d9c03
7
- data.tar.gz: d4ca43cc205e56ce7602d4d65ae33080f53631901ac7d96df12cdce2578ce7b6d3c9eb600b392b84df4de8d4a24f4f7dda22af4569d1ebebb16dab37671e9037
6
+ metadata.gz: 227ab42ce4c3ef87b9325f2570607f9beb4db7a66073f60adfb753623337394e7ddea82d221cfa9e74481f69d259321e2ef1e89de56fcb4e916f5e67de78c779
7
+ data.tar.gz: a02b2383a8495a14bd25a4b5a48eafb8fff08b3dd161a75f4d999b383f7a08a28b0e00ea3f6ade4d08c5382be72836aca53caa17fe1a07fc67e14ca813c2ffd8
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  > A complete translation editor and workflow
3
3
 
4
4
  <a href="https://badge.fury.io/rb/rails_i18n_manager" target="_blank"><img height="21" style='border:0px;height:21px;' border='0' src="https://badge.fury.io/rb/rails_i18n_manager.svg" alt="Gem Version"></a>
5
- <a href='https://github.com/westonganger/rails_i18n_manager/actions' target='_blank'><img src="https://github.com/westonganger/rails_i18n_manager/workflows/Tests/badge.svg" style="max-width:100%;" height='21' style='border:0px;height:21px;' border='0' alt="CI Status"></a>
5
+ <a href='https://github.com/westonganger/rails_i18n_manager/actions' target='_blank'><img src="https://github.com/westonganger/rails_i18n_manager/actions/workflows/test.yml/badge.svg" style="max-width:100%;" height='21' style='border:0px;height:21px;' border='0' alt="CI Status"></a>
6
6
 
7
7
  Web interface to manage i18n translations helping to facilitate the editors of your translations. Provides a low-tech and complete workflow for importing, translating, and exporting your I18n translation files. Designed to allow you to keep the translation files inside your projects git repository where they should be.
8
8
 
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images/rails_i18n_manager
2
+ //= link_directory ../stylesheets/rails_i18n_manager .css
3
+ //= link_directory ../javascripts/rails_i18n_manager .js
@@ -23,26 +23,30 @@ module RailsI18nManager
23
23
  return
24
24
  end
25
25
 
26
- if [".yml", ".json"].exclude?(File.extname(file))
27
- errors.add(:file, "Invalid file format. Must be yml or json file.")
26
+ file_extname = File.extname(file)
27
+
28
+ if [".yml", ".yaml", ".json"].exclude?(file_extname)
29
+ errors.add(:file, "Invalid file format. Must be yaml or json file.")
28
30
  return
29
31
  end
30
32
 
31
- if File.read(file).blank?
33
+ file_contents = File.read(file)
34
+
35
+ if file_contents.blank?
32
36
  errors.add(:file, "Empty file provided.")
33
37
  return
34
38
  end
35
39
 
36
- case File.extname(file)
37
- when ".yml"
38
- if !YAML.safe_load(File.read(file)).is_a?(Hash)
39
- errors.add(:file, "Invalid yml file.")
40
+ case file_extname
41
+ when ".yml", ".yaml"
42
+ if !YAML.safe_load(file_contents).is_a?(Hash)
43
+ errors.add(:file, "Invalid #{file_extname.sub(".","")} file.")
40
44
  return
41
45
  end
42
46
 
43
47
  when ".json"
44
48
  begin
45
- JSON.parse(File.read(file))
49
+ JSON.parse(file_contents)
46
50
  rescue JSON::ParserError
47
51
  errors.add(:file, "Invalid json file.")
48
52
  return
@@ -4,7 +4,7 @@ module RailsI18nManager
4
4
 
5
5
  include ActiveSortOrder
6
6
 
7
- scope :multi_search, ->(full_str){
7
+ scope :multi_search, ->(full_str){
8
8
  if full_str.present?
9
9
  rel = self
10
10
 
@@ -7,7 +7,7 @@
7
7
  options[:label_wrapper_html][:class].concat(" col-md-1 col-form-label text-md-end").strip!
8
8
 
9
9
  options[:input_wrapper_html][:class] ||= ""
10
- options[:input_wrapper_html][:class].concat(" col-auto g-md-0").strip!
10
+ options[:input_wrapper_html][:class].concat(" col-md-11").strip!
11
11
  end
12
12
 
13
13
  if type == :text_area
@@ -49,7 +49,7 @@
49
49
 
50
50
  <% field = capture do %>
51
51
  <% if type == :view %>
52
- <%= text_field_tag nil, options[:input_html][:value], options[:input_html] %>
52
+ <%= text_area_tag nil, options[:input_html][:value], options[:input_html] %>
53
53
  <% elsif type == :select %>
54
54
  <%=
55
55
  f.select(
@@ -7,4 +7,4 @@
7
7
 
8
8
  .nested-fields.translation-value-fields
9
9
  = f.hidden_field :locale
10
- = f.field :translation, type: :textarea, label: "#{locale}", required: required, help_text: help_text, field_layout: :horizontal, input_html: {rows: 1, width: "100%;"}
10
+ = f.field :translation, type: :textarea, label: "#{locale}", required: required, help_text: help_text, field_layout: :horizontal, input_html: {rows: 1}
@@ -17,27 +17,27 @@ module RailsI18nManager
17
17
  app.middleware.use ::ActionDispatch::Static, "#{root}/public"
18
18
  end
19
19
 
20
- ### Were not using sprockets were just storing everything in public
21
- ### Sprockets Config below
22
- # initializer "rails_i18n_manager.assets.precompile" do |app|
23
- # app.config.assets.precompile << "rails_i18n_manager_manifest.js" ### manifest file required
24
- # app.config.assets.precompile << "rails_i18n_manager/favicon.ico"
25
-
26
- # ### Automatically precompile assets in specified folders
27
- # ["app/assets/images/"].each do |folder|
28
- # dir = app.root.join(folder)
29
-
30
- # if Dir.exist?(dir)
31
- # Dir.glob(File.join(dir, "**/*")).each do |f|
32
- # asset_name = f.to_s
33
- # .split(folder).last # Remove fullpath
34
- # .sub(/^\/*/, '') ### Remove leading '/'
35
-
36
- # app.config.assets.precompile << asset_name
37
- # end
38
- # end
39
- # end
40
- # end
20
+ initializer "rails_i18n_manager.assets.precompile" do |app|
21
+ # this initializer is only called when sprockets is in use
22
+
23
+ app.config.assets.precompile << "rails_i18n_manager_manifest.js" ### manifest file required
24
+ app.config.assets.precompile << "rails_i18n_manager/favicon.ico"
25
+
26
+ ### Automatically precompile assets in specified folders
27
+ ["app/assets/images/"].each do |folder|
28
+ dir = app.root.join(folder)
29
+
30
+ if Dir.exist?(dir)
31
+ Dir.glob(File.join(dir, "**/*")).each do |f|
32
+ asset_name = f.to_s
33
+ .split(folder).last # Remove fullpath
34
+ .sub(/^\/*/, '') ### Remove leading '/'
35
+
36
+ app.config.assets.precompile << asset_name
37
+ end
38
+ end
39
+ end
40
+ end
41
41
 
42
42
  end
43
43
  end
@@ -1,3 +1,3 @@
1
1
  module RailsI18nManager
2
- VERSION = '1.0.1'
2
+ VERSION = "1.0.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_i18n_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Weston Ganger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-18 00:00:00.000000000 Z
11
+ date: 2024-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '6.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '5.0'
26
+ version: '6.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: slim
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -220,6 +220,11 @@ files:
220
220
  - LICENSE
221
221
  - README.md
222
222
  - Rakefile
223
+ - app/assets/config/rails_i18n_manager_manifest.rb
224
+ - app/assets/images/rails_i18n_manager/favicon.ico
225
+ - app/assets/javascripts/rails_i18n_manager/application.js
226
+ - app/assets/stylesheets/rails_i18n_manager/application.css
227
+ - app/assets/stylesheets/rails_i18n_manager/utility.css
223
228
  - app/controllers/rails_i18n_manager/application_controller.rb
224
229
  - app/controllers/rails_i18n_manager/translation_apps_controller.rb
225
230
  - app/controllers/rails_i18n_manager/translations_controller.rb
@@ -265,10 +270,6 @@ files:
265
270
  - lib/rails_i18n_manager/config.rb
266
271
  - lib/rails_i18n_manager/engine.rb
267
272
  - lib/rails_i18n_manager/version.rb
268
- - public/rails_i18n_manager/application.css
269
- - public/rails_i18n_manager/application.js
270
- - public/rails_i18n_manager/favicon.ico
271
- - public/rails_i18n_manager/utility.css
272
273
  homepage: https://github.com/westonganger/rails_i18n_manager
273
274
  licenses:
274
275
  - MIT
@@ -288,7 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
288
289
  - !ruby/object:Gem::Version
289
290
  version: '0'
290
291
  requirements: []
291
- rubygems_version: 3.4.6
292
+ rubygems_version: 3.4.22
292
293
  signing_key:
293
294
  specification_version: 4
294
295
  summary: Web interface to manage i18n translations for your apps to facilitate the