lesli_babel 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,12 +19,7 @@ module LesliBabel
19
19
  strings = strings.where("lesli_babel_buckets.id in (?)", buckets_id)
20
20
  end
21
21
 
22
- strings
23
- end
24
-
25
- def index params
26
-
27
- strings = self.list(params[:module]).select(
22
+ strings.select(
28
23
  :id,
29
24
  :label,
30
25
  :status,
@@ -38,9 +33,10 @@ module LesliBabel
38
33
  "'' as path"
39
34
  )
40
35
 
41
- #strings = strings.where()
36
+ end
42
37
 
43
- strings = strings
38
+ def index params
39
+ self.list(params[:module])
44
40
  .page(query[:pagination][:page])
45
41
  .per(query[:pagination][:perPage])
46
42
  .order(:updated_at)
@@ -51,25 +47,24 @@ module LesliBabel
51
47
  Rails.cache.fetch("babel/strings/stats", expires_in: 1.hour) do
52
48
 
53
49
  # total translations registered in babel
54
- total_strings = self.list.count
50
+ total_strings = self.list.reselect(:id).count
55
51
 
56
52
  # total translations by language
57
53
  total_strings_translations = []
58
54
 
59
- #Rails.application.config.lesli.dig(:configuration, :locales_available).each do |locale|
60
55
  Lesli.config.locales.each do |locale|
61
56
  total_strings_translations.push({
62
57
  code: locale[0],
63
58
  name: locale[1],
64
- total: self.list.where("#{locale[0]} is not null").where("#{locale[0]} != ''").count
59
+ total: self.list.reselect(:id).where("#{locale[0]} is not null").where("#{locale[0]} != ''").count
65
60
  })
66
61
  end
67
62
 
68
63
  # total translations that needs help
69
- total_strings_waiting_for_help = self.list.where(:status => 1).count
64
+ total_strings_waiting_for_help = 0#self.list.reselect(:id).where(:status => 1).count
70
65
 
71
66
  # total translations that needs translation
72
- total_strings_waiting_for_translation = self.list.where(:status => 2).count
67
+ total_strings_waiting_for_translation = 0 #self.list.reselect(:id).where(:status => 2).count
73
68
 
74
69
  {
75
70
  total_strings: total_strings,
@@ -15,6 +15,7 @@
15
15
  view_status_inactive: Inactive
16
16
  button_settings: Settings
17
17
  button_show: Show
18
+ toolbar_search: Search...
18
19
  application:
19
20
  navigation_logout: Logout
20
21
  navigation_my_profile: My profile
@@ -15,6 +15,7 @@
15
15
  view_status_inactive: Inactivo
16
16
  button_settings: Configuración
17
17
  button_show: Ver
18
+ toolbar_search: Buscar...
18
19
  application:
19
20
  navigation_logout: Cerrar sesión
20
21
  navigation_my_profile: Mi perfil
@@ -0,0 +1,21 @@
1
+ ---
2
+ :fr:
3
+ lesli:
4
+ shared:
5
+ view_discussions: ":lesli.shared.view_discussions:"
6
+ button_add_new: ":lesli.shared.button_add_new:"
7
+ button_reload: ":lesli.shared.button_reload:"
8
+ view_files: ":lesli.shared.view_files:"
9
+ view_quick_actions: ":lesli.shared.view_quick_actions:"
10
+ button_list: ":lesli.shared.button_list:"
11
+ button_save: ":lesli.shared.button_save:"
12
+ button_delete: ":lesli.shared.button_delete:"
13
+ button_edit: ":lesli.shared.button_edit:"
14
+ view_status_active: ":lesli.shared.view_status_active:"
15
+ view_status_inactive: ":lesli.shared.view_status_inactive:"
16
+ button_settings: ":lesli.shared.button_settings:"
17
+ button_show: ":lesli.shared.button_show:"
18
+ toolbar_search: ":lesli.shared.toolbar_search:"
19
+ application:
20
+ navigation_logout: ":lesli.application.navigation_logout:"
21
+ navigation_my_profile: ":lesli.application.navigation_my_profile:"
@@ -0,0 +1,21 @@
1
+ ---
2
+ :it:
3
+ lesli:
4
+ shared:
5
+ view_discussions: ":lesli.shared.view_discussions:"
6
+ button_add_new: ":lesli.shared.button_add_new:"
7
+ button_reload: ":lesli.shared.button_reload:"
8
+ view_files: ":lesli.shared.view_files:"
9
+ view_quick_actions: ":lesli.shared.view_quick_actions:"
10
+ button_list: ":lesli.shared.button_list:"
11
+ button_save: ":lesli.shared.button_save:"
12
+ button_delete: ":lesli.shared.button_delete:"
13
+ button_edit: ":lesli.shared.button_edit:"
14
+ view_status_active: ":lesli.shared.view_status_active:"
15
+ view_status_inactive: ":lesli.shared.view_status_inactive:"
16
+ button_settings: ":lesli.shared.button_settings:"
17
+ button_show: ":lesli.shared.button_show:"
18
+ toolbar_search: ":lesli.shared.toolbar_search:"
19
+ application:
20
+ navigation_logout: ":lesli.application.navigation_logout:"
21
+ navigation_my_profile: ":lesli.application.navigation_my_profile:"
@@ -0,0 +1,21 @@
1
+ ---
2
+ :pt:
3
+ lesli:
4
+ shared:
5
+ view_discussions: ":lesli.shared.view_discussions:"
6
+ button_add_new: ":lesli.shared.button_add_new:"
7
+ button_reload: ":lesli.shared.button_reload:"
8
+ view_files: ":lesli.shared.view_files:"
9
+ view_quick_actions: ":lesli.shared.view_quick_actions:"
10
+ button_list: ":lesli.shared.button_list:"
11
+ button_save: ":lesli.shared.button_save:"
12
+ button_delete: ":lesli.shared.button_delete:"
13
+ button_edit: ":lesli.shared.button_edit:"
14
+ view_status_active: ":lesli.shared.view_status_active:"
15
+ view_status_inactive: ":lesli.shared.view_status_inactive:"
16
+ button_settings: ":lesli.shared.button_settings:"
17
+ button_show: ":lesli.shared.button_show:"
18
+ toolbar_search: ":lesli.shared.toolbar_search:"
19
+ application:
20
+ navigation_logout: ":lesli.application.navigation_logout:"
21
+ navigation_my_profile: ":lesli.application.navigation_my_profile:"
@@ -1,4 +1,4 @@
1
1
  module LesliBabel
2
- VERSION = "0.6.0"
3
- BUILD = "1709502821"
2
+ VERSION = "0.7.0"
3
+ BUILD = "1713121383"
4
4
  end
@@ -32,6 +32,8 @@ Building a better future, one line of code at a time.
32
32
 
33
33
  # ·
34
34
  require "json"
35
+
36
+
35
37
  namespace :lesli_babel do
36
38
 
37
39
  desc "Delete translations files"
@@ -45,7 +47,7 @@ namespace :lesli_babel do
45
47
  end
46
48
 
47
49
  desc "Create standard structure for translations according to the objects in the app"
48
- task build: [:environment] do
50
+ task scan: [:environment] do
49
51
 
50
52
  engines = Lesli::SystemController.index(matrix: true)
51
53
 
@@ -77,7 +79,7 @@ namespace :lesli_babel do
77
79
  end
78
80
  end
79
81
 
80
- L2.msg "CloudBabel: Module/Controllers scanned and registered"
82
+ L2.msg "LesliBabel: Module/Controllers scanned and registered"
81
83
 
82
84
  end
83
85
 
@@ -106,6 +108,7 @@ namespace :lesli_babel do
106
108
  "!*.errors",
107
109
  "!*.number.nth",
108
110
  "*.lesli.shared.*",
111
+ "*.lesli.dashboards.*",
109
112
  "*.lesli.application.*",
110
113
  "*.#{engine_info[:code]}.*",
111
114
 
@@ -169,6 +172,10 @@ namespace :lesli_babel do
169
172
  bucket_id: translation_bucket.id
170
173
  )
171
174
 
175
+
176
+ # do not save strings with template translation
177
+ next if translation.match?(/\A:.*:\z/)
178
+
172
179
  # add the correct translation to the label
173
180
  label.update(locale => translation)
174
181
  end
@@ -5,6 +5,12 @@
5
5
  "navigation_logout": "Logout",
6
6
  "navigation_my_profile": "My profile"
7
7
  },
8
+ "dashboards": {
9
+ "column_default": "Default",
10
+ "column_name": "Name",
11
+ "title": "Dashboards",
12
+ "view_add_component": "Add component"
13
+ },
8
14
  "shared": {
9
15
  "button_add_new": "Add new",
10
16
  "button_delete": "Delete",
@@ -14,6 +20,7 @@
14
20
  "button_save": "Save",
15
21
  "button_settings": "Settings",
16
22
  "button_show": "Show",
23
+ "toolbar_search": "Search...",
17
24
  "view_discussions": "Discussions",
18
25
  "view_files": "Files",
19
26
  "view_quick_actions": "Quick actions",
@@ -28,6 +35,12 @@
28
35
  "navigation_logout": "Cerrar sesión",
29
36
  "navigation_my_profile": "Mi perfil"
30
37
  },
38
+ "dashboards": {
39
+ "column_default": "Default",
40
+ "column_name": "Nombre",
41
+ "title": "Dashboards",
42
+ "view_add_component": "Agregar componente"
43
+ },
31
44
  "shared": {
32
45
  "button_add_new": "Agregar nuevo",
33
46
  "button_delete": "Eliminar",
@@ -37,6 +50,7 @@
37
50
  "button_save": "Guardar",
38
51
  "button_settings": "Configuración",
39
52
  "button_show": "Ver",
53
+ "toolbar_search": "Buscar...",
40
54
  "view_discussions": "Discusiones",
41
55
  "view_files": "Archivos",
42
56
  "view_quick_actions": "Acciones rapidas",
@@ -44,5 +58,95 @@
44
58
  "view_status_inactive": "Inactivo"
45
59
  }
46
60
  }
61
+ },
62
+ "fr": {
63
+ "lesli": {
64
+ "application": {
65
+ "navigation_logout": ":lesli.application.navigation_logout:",
66
+ "navigation_my_profile": ":lesli.application.navigation_my_profile:"
67
+ },
68
+ "dashboards": {
69
+ "column_default": ":lesli.dashboards.column_default:",
70
+ "column_name": ":lesli.dashboards.column_name:",
71
+ "title": ":lesli.dashboards.title:",
72
+ "view_add_component": ":lesli.dashboards.view_add_component:"
73
+ },
74
+ "shared": {
75
+ "button_add_new": ":lesli.shared.button_add_new:",
76
+ "button_delete": ":lesli.shared.button_delete:",
77
+ "button_edit": ":lesli.shared.button_edit:",
78
+ "button_list": ":lesli.shared.button_list:",
79
+ "button_reload": ":lesli.shared.button_reload:",
80
+ "button_save": ":lesli.shared.button_save:",
81
+ "button_settings": ":lesli.shared.button_settings:",
82
+ "button_show": ":lesli.shared.button_show:",
83
+ "toolbar_search": ":lesli.shared.toolbar_search:",
84
+ "view_discussions": ":lesli.shared.view_discussions:",
85
+ "view_files": ":lesli.shared.view_files:",
86
+ "view_quick_actions": ":lesli.shared.view_quick_actions:",
87
+ "view_status_active": ":lesli.shared.view_status_active:",
88
+ "view_status_inactive": ":lesli.shared.view_status_inactive:"
89
+ }
90
+ }
91
+ },
92
+ "it": {
93
+ "lesli": {
94
+ "application": {
95
+ "navigation_logout": ":lesli.application.navigation_logout:",
96
+ "navigation_my_profile": ":lesli.application.navigation_my_profile:"
97
+ },
98
+ "dashboards": {
99
+ "column_default": ":lesli.dashboards.column_default:",
100
+ "column_name": ":lesli.dashboards.column_name:",
101
+ "title": ":lesli.dashboards.title:",
102
+ "view_add_component": ":lesli.dashboards.view_add_component:"
103
+ },
104
+ "shared": {
105
+ "button_add_new": ":lesli.shared.button_add_new:",
106
+ "button_delete": ":lesli.shared.button_delete:",
107
+ "button_edit": ":lesli.shared.button_edit:",
108
+ "button_list": ":lesli.shared.button_list:",
109
+ "button_reload": ":lesli.shared.button_reload:",
110
+ "button_save": ":lesli.shared.button_save:",
111
+ "button_settings": ":lesli.shared.button_settings:",
112
+ "button_show": ":lesli.shared.button_show:",
113
+ "toolbar_search": ":lesli.shared.toolbar_search:",
114
+ "view_discussions": ":lesli.shared.view_discussions:",
115
+ "view_files": ":lesli.shared.view_files:",
116
+ "view_quick_actions": ":lesli.shared.view_quick_actions:",
117
+ "view_status_active": ":lesli.shared.view_status_active:",
118
+ "view_status_inactive": ":lesli.shared.view_status_inactive:"
119
+ }
120
+ }
121
+ },
122
+ "pt": {
123
+ "lesli": {
124
+ "application": {
125
+ "navigation_logout": ":lesli.application.navigation_logout:",
126
+ "navigation_my_profile": ":lesli.application.navigation_my_profile:"
127
+ },
128
+ "dashboards": {
129
+ "column_default": ":lesli.dashboards.column_default:",
130
+ "column_name": ":lesli.dashboards.column_name:",
131
+ "title": ":lesli.dashboards.title:",
132
+ "view_add_component": ":lesli.dashboards.view_add_component:"
133
+ },
134
+ "shared": {
135
+ "button_add_new": ":lesli.shared.button_add_new:",
136
+ "button_delete": ":lesli.shared.button_delete:",
137
+ "button_edit": ":lesli.shared.button_edit:",
138
+ "button_list": ":lesli.shared.button_list:",
139
+ "button_reload": ":lesli.shared.button_reload:",
140
+ "button_save": ":lesli.shared.button_save:",
141
+ "button_settings": ":lesli.shared.button_settings:",
142
+ "button_show": ":lesli.shared.button_show:",
143
+ "toolbar_search": ":lesli.shared.toolbar_search:",
144
+ "view_discussions": ":lesli.shared.view_discussions:",
145
+ "view_files": ":lesli.shared.view_files:",
146
+ "view_quick_actions": ":lesli.shared.view_quick_actions:",
147
+ "view_status_active": ":lesli.shared.view_status_active:",
148
+ "view_status_inactive": ":lesli.shared.view_status_inactive:"
149
+ }
150
+ }
47
151
  }
48
152
  }
data/readme.md CHANGED
@@ -3,12 +3,21 @@
3
3
  <h3 align="center">Translation Management System for the Lesli Framework.</h3>
4
4
  </p>
5
5
 
6
+
6
7
  <hr/>
7
- <p align="center">
8
- <a target="blank" href="https://rubygems.org/gems/lesli_babel">
9
- <img height="22" alt="Gem Version" src="https://badge.fury.io/rb/lesli_babel.svg" />
10
- </a>
11
- </p>
8
+
9
+ <p align="center" class="is-flex is-justify-content-center">
10
+ <a target="blank" href="https://rubygems.org/gems/lesli_babel">
11
+ <img height="22" alt="Gem Version" src="https://badge.fury.io/rb/lesli_babel.svg" />
12
+ </a>
13
+ <a class="mx-2" href="https://codecov.io/github/LesliTech/Lesli">
14
+ <img height="22" src="https://codecov.io/github/LesliTech/Lesli/graph/badge.svg?token=2O12NENK5Y"/>
15
+ </a>
16
+ <a href="https://codecov.io/github/LesliTech/Lesli">
17
+ <img height="22" src="https://sonarcloud.io/api/project_badges/measure?project=LesliTech_Lesli&metric=sqale_rating"/>
18
+ </a>
19
+ </p>
20
+
12
21
  <hr/>
13
22
 
14
23
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lesli_babel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Lesli Development Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-03 00:00:00.000000000 Z
11
+ date: 2024-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -116,6 +116,9 @@ files:
116
116
  - app/views/lesli_babel/translations/show.html.erb
117
117
  - config/locales/translations.en.yml
118
118
  - config/locales/translations.es.yml
119
+ - config/locales/translations.fr.yml
120
+ - config/locales/translations.it.yml
121
+ - config/locales/translations.pt.yml
119
122
  - config/routes.rb
120
123
  - db/migrate/v1.0/0901100110_create_lesli_babel_modules.rb
121
124
  - db/migrate/v1.0/0901110110_create_lesli_babel_buckets.rb