i18n-analyzer 0.1.5 → 0.1.7
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: f73a9a8a8092ac783a6aa139c7ce6566d6b314b6c861cda8360fe8feb7441c67
|
4
|
+
data.tar.gz: b6f70dd2fc859b006e44419136d7b673067a11e39639620478772e67de876063
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5905bb94b5d8e0d9ddb7f81ed8f436d1eef6ebe8068346327eac11a3fb2d2e5473f5326b294e7de78f9979de1f52cd2aab055bf8fe483bee6f9022e669a33077
|
7
|
+
data.tar.gz: 958b98769c4b39b817fe3650b6a2d1e6a618fd58f9a586a7f9a3f9458ec313b0d0e18f403f2013f00b5f514d5ed42f8aeef6df302882b890fc44fa883977a118
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# I18n::Analyzer
|
2
|
-
I18n-Analyzer is a small and mountable gem developed by open-circle-ltd for analyzing I18n translations. It gives you an additional page, where you can exactly see,
|
2
|
+
I18n-Analyzer is a small and mountable gem developed by open-circle-ltd for analyzing I18n translations. It gives you an additional page, where you can exactly see, which model classes are translated and which fields of those model classes are still missing.
|
3
|
+
|
4
|
+
RubyGems: <https://rubygems.org/gems/i18n-analyzer>
|
3
5
|
|
4
6
|
## Usage
|
5
7
|
Look at the installation section
|
@@ -18,13 +20,9 @@ mount I18n::Analyzer::Engine, at: '/analyzer'
|
|
18
20
|
```
|
19
21
|
it is also possible to create another link, if it is necessary
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
authenticate :admin do
|
25
|
-
# other mountable apps, not visible for the world
|
26
|
-
mount I18n::Analyzer::Engine, at: '/analyzer'
|
27
|
-
end
|
23
|
+
Or install it yourself as:
|
24
|
+
```bash
|
25
|
+
$ gem install i18n-analyzer
|
28
26
|
```
|
29
27
|
|
30
28
|
And then execute:
|
@@ -32,10 +30,13 @@ And then execute:
|
|
32
30
|
$ bundle
|
33
31
|
```
|
34
32
|
|
35
|
-
|
36
|
-
|
37
|
-
```
|
38
|
-
|
33
|
+
### Security Note
|
34
|
+
If the analyzer is being mounted, it is recommended to safeguard it by mounting the analyzer in a protected namespace, an example would look like this in routes.rb:
|
35
|
+
```ruby
|
36
|
+
authenticate :admin do
|
37
|
+
# other mountable apps, not visible for the world
|
38
|
+
mount I18n::Analyzer::Engine, at: '/analyzer'
|
39
|
+
end
|
39
40
|
```
|
40
41
|
|
41
42
|
## Using Library locally
|
@@ -1,25 +1,69 @@
|
|
1
|
-
-#
|
2
|
-
-# NOTE: CSS was implemented to make the functionality presentable. Please do not roast this css
|
1
|
+
-# NOTE: CSS was implemented to make the functionality presentable and readable. Please do not roast this css
|
3
2
|
:css
|
4
|
-
|
3
|
+
body {
|
4
|
+
text-align: left;
|
5
|
+
}
|
6
|
+
*{ font-family: sans-serif;
|
7
|
+
/*margin-left: auto;*/
|
8
|
+
/* margin-right: auto; */
|
9
|
+
}
|
10
|
+
|
11
|
+
.analyzer-table {
|
12
|
+
font-family: Arial, Helvetica, sans-serif;
|
13
|
+
border-collapse: collapse;
|
14
|
+
|
15
|
+
margin-left: auto;
|
16
|
+
margin-right: auto;
|
17
|
+
|
18
|
+
/*width: 60%;*/
|
19
|
+
/*background-color: chartreuse;*/
|
20
|
+
background-color: #cce1dc;
|
21
|
+
}
|
22
|
+
|
23
|
+
.analyzer-table td, .analyzer-table th {
|
24
|
+
border: 1px solid #ddd;
|
25
|
+
padding: 8px;
|
26
|
+
}
|
27
|
+
|
28
|
+
.analyzer-table th {
|
29
|
+
padding-top: 12px;
|
30
|
+
padding-bottom: 12px;
|
31
|
+
background-color: #0d3862;
|
32
|
+
color: white;
|
33
|
+
}
|
34
|
+
|
35
|
+
.analyzer-table th a {
|
36
|
+
color: white;
|
37
|
+
text-decoration: none;
|
38
|
+
}
|
39
|
+
|
40
|
+
.text-center {
|
41
|
+
text-align: center;
|
42
|
+
}
|
43
|
+
.text-right {
|
44
|
+
text-align: right;
|
45
|
+
}
|
46
|
+
.no-translation {
|
47
|
+
background-color: #f3d4d1; }
|
48
|
+
/*#cce1dc*/
|
49
|
+
|
50
|
+
%h1.text-center ActiveRecord Translations
|
5
51
|
|
6
|
-
%h1 I18N - ActiveRecord Debug
|
7
|
-
- Rails.application.eager_load! if Rails.env.development?
|
8
|
-
- models = ApplicationRecord.descendants
|
9
52
|
%table.analyzer-table
|
10
53
|
%tr
|
11
|
-
%th
|
12
|
-
%th{colspan: 2} DE
|
13
|
-
%th{colspan: 2} EN
|
54
|
+
%th.text-center Model
|
55
|
+
%th.text-center{colspan: 2} DE
|
56
|
+
%th.text-center{colspan: 2} EN
|
14
57
|
%tr
|
15
|
-
%th
|
16
|
-
%th Singular
|
17
|
-
%th Plural
|
18
|
-
%th Singular
|
19
|
-
%th Plural
|
20
|
-
|
58
|
+
%th
|
59
|
+
%th.text-center Singular
|
60
|
+
%th.text-center Plural
|
61
|
+
%th.text-center Singular
|
62
|
+
%th.text-center Plural
|
63
|
+
|
64
|
+
- @models.sort_by { |i| i.name }.each do |model|
|
21
65
|
%tr
|
22
|
-
%th= model.name
|
66
|
+
%th.text-right= link_to model.name, "#model-#{model.name}"
|
23
67
|
- I18n.with_locale(:de) do
|
24
68
|
%td{class: "#{'no-translation' if model.model_name.human(count: 1, default: '').empty?}"}
|
25
69
|
= model.model_name.human(count: 1)
|
@@ -32,17 +76,17 @@
|
|
32
76
|
%td{class: "#{'no-translation' if model.model_name.human(count: 99, default: '').empty?}"}
|
33
77
|
= model.model_name.human(count: 99)
|
34
78
|
|
35
|
-
- models.sort_by { |i| i.name }.each do |model|
|
36
|
-
%h2= model.name
|
79
|
+
- @models.sort_by { |i| i.name }.each do |model|
|
80
|
+
%h2.text-center{id: "model-#{model.name}"}= model.name
|
37
81
|
%table.analyzer-table
|
38
82
|
%tr
|
39
|
-
%th Attribute
|
83
|
+
%th.text-right Attribute
|
40
84
|
-# TODO: make it, that it reads out the languages from the project and then it loops through the languages
|
41
|
-
%th DE
|
42
|
-
%th EN
|
85
|
+
%th.text-center DE
|
86
|
+
%th.text-center EN
|
43
87
|
- model.new.attributes.sort_by { |i| i }.each do |atr, _value|
|
44
88
|
%tr
|
45
|
-
%th= atr
|
89
|
+
%th.text-right= atr
|
46
90
|
- I18n.with_locale(:de) do
|
47
91
|
%td{class: "#{'no-translation' if model.human_attribute_name(atr, default: '').empty?}"}
|
48
92
|
= model.human_attribute_name(atr)
|
metadata
CHANGED
@@ -1,34 +1,34 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-analyzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- opencircle-operator
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-31 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rails
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
|
-
- - "
|
16
|
+
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
18
|
version: '7.0'
|
19
|
-
- - "
|
19
|
+
- - "<"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: '9'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- - "
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '7.0'
|
29
|
-
- - "
|
29
|
+
- - "<"
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version:
|
31
|
+
version: '9'
|
32
32
|
- !ruby/object:Gem::Dependency
|
33
33
|
name: haml
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
|
-
rubygems_version: 3.6.
|
94
|
+
rubygems_version: 3.6.6
|
95
95
|
specification_version: 4
|
96
96
|
summary: A mountable gem for analyzing I18n translations in your rails application.
|
97
97
|
test_files: []
|