rails_i18n_manager 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/lib/rails_i18n_manager/forms/translation_file_form.rb +12 -8
- data/app/views/rails_i18n_manager/form_builder/_basic_field.html.erb +2 -2
- data/app/views/rails_i18n_manager/translations/_translation_value_fields.html.slim +1 -1
- data/lib/rails_i18n_manager/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1582e51311f1da753a0240ed429a9b7dbec17704410f633ffc6a5efa15a5da38
|
4
|
+
data.tar.gz: 2e72a24e32dd28d8a3b7a738fe182f09ba8451ca44a67db8577da02a3fd4a4e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4be1f55dade0acd9bc08c0f411d3ef294e8d94575a8d1add5af734901bb5112f520282936582133cdf766f12519e555e016ea04e699de8cd8266d45a3f7c8c20
|
7
|
+
data.tar.gz: 92908f9f5c2778c0cfacb737f0f33690b322dcaf91674a4c82ec100b7ba9c249625cd292dca478e8ff5efb308f9a4d5d10019466ec9020f80d2ecefcb0d317b7
|
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/
|
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
|
|
@@ -23,26 +23,30 @@ module RailsI18nManager
|
|
23
23
|
return
|
24
24
|
end
|
25
25
|
|
26
|
-
|
27
|
-
|
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
|
-
|
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
|
37
|
-
when ".yml"
|
38
|
-
if !YAML.safe_load(
|
39
|
-
errors.add(:file, "Invalid
|
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(
|
49
|
+
JSON.parse(file_contents)
|
46
50
|
rescue JSON::ParserError
|
47
51
|
errors.add(:file, "Invalid json file.")
|
48
52
|
return
|
@@ -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-
|
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
|
-
<%=
|
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
|
10
|
+
= f.field :translation, type: :textarea, label: "#{locale}", required: required, help_text: help_text, field_layout: :horizontal, input_html: {rows: 1}
|
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.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Weston Ganger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-07 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: '
|
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: '
|
26
|
+
version: '6.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: slim
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
- !ruby/object:Gem::Version
|
289
289
|
version: '0'
|
290
290
|
requirements: []
|
291
|
-
rubygems_version: 3.4.
|
291
|
+
rubygems_version: 3.4.22
|
292
292
|
signing_key:
|
293
293
|
specification_version: 4
|
294
294
|
summary: Web interface to manage i18n translations for your apps to facilitate the
|