lesli_babel 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/lesli_babel/application.js +1824 -1386
  3. data/app/assets/javascripts/lesli_babel/application.js.LICENSE.txt +282 -0
  4. data/app/assets/stylesheets/lesli_babel/dashboards.scss +2 -1
  5. data/app/controllers/lesli_babel/buckets_controller.rb +31 -1
  6. data/app/controllers/lesli_babel/modules_controller.rb +1 -1
  7. data/app/controllers/lesli_babel/strings_controller.rb +1 -1
  8. data/app/controllers/lesli_babel/translations_controller.rb +23 -12
  9. data/app/models/lesli_babel/module.rb +11 -3
  10. data/app/models/lesli_babel/string.rb +3 -4
  11. data/app/services/lesli_babel/deploy_rails_service.rb +142 -0
  12. data/app/services/lesli_babel/module_service.rb +1 -1
  13. data/app/services/lesli_babel/string_service.rb +2 -2
  14. data/app/views/lesli_babel/partials/_engine-sidebar.html.erb +3 -3
  15. data/config/locales/translations.en.yml +20 -0
  16. data/config/locales/translations.es.yml +20 -0
  17. data/config/routes.rb +1 -2
  18. data/db/migrate/v1.0/0901100110_create_lesli_babel_modules.rb +2 -2
  19. data/db/migrate/v1.0/0901110110_create_lesli_babel_buckets.rb +1 -1
  20. data/lib/lesli_babel/engine.rb +2 -0
  21. data/lib/lesli_babel/version.rb +2 -2
  22. data/lib/tasks/lesli_babel_tasks.rake +112 -54
  23. data/lib/vue/application.js +33 -10
  24. data/lib/vue/apps/modules/show.vue +25 -11
  25. data/lib/vue/components/form-string-new.vue +14 -43
  26. data/lib/vue/stores/module.js +25 -11
  27. data/lib/vue/stores/string.js +84 -0
  28. data/lib/vue/stores/translations.js +1 -1
  29. data/lib/vue/stores/translations.json +48 -0
  30. data/readme.md +62 -9
  31. metadata +42 -7
@@ -0,0 +1,282 @@
1
+ /*
2
+
3
+ Lesli
4
+
5
+ Copyright (c) 2023, Lesli Technologies, S. A.
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 3 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see http://www.gnu.org/licenses/.
19
+
20
+ Lesli · Ruby on Rails SaaS Development Framework.
21
+
22
+ Made with ♥ by https://www.lesli.tech
23
+ Building a better future, one line of code at a time.
24
+
25
+ @contact hello@lesli.tech
26
+ @website https://www.lesli.tech
27
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
+
29
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
+ // ·
31
+ */
32
+
33
+ /*
34
+
35
+ Lesli
36
+
37
+ Copyright (c) 2023, Lesli Technologies, S. A.
38
+
39
+ This program is free software: you can redistribute it and/or modify
40
+ it under the terms of the GNU General Public License as published by
41
+ the Free Software Foundation, either version 3 of the License, or
42
+ (at your option) any later version.
43
+
44
+ This program is distributed in the hope that it will be useful,
45
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
46
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47
+ GNU General Public License for more details.
48
+
49
+ You should have received a copy of the GNU General Public License
50
+ along with this program. If not, see http://www.gnu.org/licenses/.
51
+
52
+ Lesli · Your Smart Business Assistant.
53
+
54
+ Made with ♥ by https://www.lesli.tech
55
+ Building a better future, one line of code at a time.
56
+
57
+ @contact hello@lesli.tech
58
+ @website https://lesli.tech
59
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
60
+
61
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
62
+ // ·
63
+
64
+ */
65
+
66
+ /*
67
+
68
+ Lesli
69
+
70
+ Copyright (c) 2023, Lesli Technologies, S. A.
71
+
72
+ This program is free software: you can redistribute it and/or modify
73
+ it under the terms of the GNU General Public License as published by
74
+ the Free Software Foundation, either version 3 of the License, or
75
+ (at your option) any later version.
76
+
77
+ This program is distributed in the hope that it will be useful,
78
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
79
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
80
+ GNU General Public License for more details.
81
+
82
+ You should have received a copy of the GNU General Public License
83
+ along with this program. If not, see http://www.gnu.org/licenses/.
84
+
85
+ Lesli · Your Smart Business Assistant.
86
+
87
+ Made with ♥ by https://www.lesli.tech
88
+ Building a better future, one line of code at a time.
89
+
90
+ @contact hello@lesli.tech
91
+ @website https://lesli.tech
92
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
93
+
94
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
95
+ // ·
96
+ */
97
+
98
+ /*
99
+ Lesli
100
+
101
+ Copyright (c) 2023, Lesli Technologies, S. A.
102
+
103
+ This program is free software: you can redistribute it and/or modify
104
+ it under the terms of the GNU General Public License as published by
105
+ the Free Software Foundation, either version 3 of the License, or
106
+ (at your option) any later version.
107
+
108
+ This program is distributed in the hope that it will be useful,
109
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
110
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
111
+ GNU General Public License for more details.
112
+
113
+ You should have received a copy of the GNU General Public License
114
+ along with this program. If not, see http://www.gnu.org/licenses/.
115
+
116
+ Lesli · Ruby on Rails SaaS Development Framework.
117
+
118
+ Made with ♥ by https://www.lesli.tech
119
+ Building a better future, one line of code at a time.
120
+
121
+ @contact hello@lesli.tech
122
+ @website https://www.lesli.dev
123
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
124
+
125
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
126
+ // ·
127
+ */
128
+
129
+ /*
130
+ Lesli
131
+
132
+ Copyright (c) 2023, Lesli Technologies, S. A.
133
+
134
+ This program is free software: you can redistribute it and/or modify
135
+ it under the terms of the GNU General Public License as published by
136
+ the Free Software Foundation, either version 3 of the License, or
137
+ (at your option) any later version.
138
+
139
+ This program is distributed in the hope that it will be useful,
140
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
141
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
142
+ GNU General Public License for more details.
143
+
144
+ You should have received a copy of the GNU General Public License
145
+ along with this program. If not, see http://www.gnu.org/licenses/.
146
+
147
+ Lesli · Ruby on Rails SaaS development platform.
148
+
149
+ Made with ♥ by https://www.lesli.tech
150
+ Building a better future, one line of code at a time.
151
+
152
+ @contact hello@lesli.tech
153
+ @website https://www.lesli.tech
154
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
155
+
156
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
157
+ // ·
158
+ */
159
+
160
+ /*
161
+ Lesli
162
+
163
+ Copyright (c) 2020, Lesli Technologies, S. A.
164
+
165
+ This program is free software: you can redistribute it and/or modify
166
+ it under the terms of the GNU General Public License as published by
167
+ the Free Software Foundation, either version 3 of the License, or
168
+ (at your option) any later version.
169
+
170
+ This program is distributed in the hope that it will be useful,
171
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
172
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
173
+ GNU General Public License for more details.
174
+
175
+ You should have received a copy of the GNU General Public License
176
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
177
+
178
+ Lesli JS - JavaScript utilities for JavaScript applications
179
+
180
+ Powered by LesliTech
181
+ Building a better future, one line of code at a time.
182
+
183
+ @contact <hello@lesli.tech>
184
+ @website <https://lesli.tech>
185
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
186
+
187
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
188
+ // ·
189
+ */
190
+
191
+ /*
192
+ Lesli
193
+
194
+ Copyright (c) 2021, Lesli Technologies, S. A.
195
+
196
+ This program is free software: you can redistribute it and/or modify
197
+ it under the terms of the GNU General Public License as published by
198
+ the Free Software Foundation, either version 3 of the License, or
199
+ (at your option) any later version.
200
+
201
+ This program is distributed in the hope that it will be useful,
202
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
203
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
204
+ GNU General Public License for more details.
205
+
206
+ You should have received a copy of the GNU General Public License
207
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
208
+
209
+ Lesli JS - JavaScript utilities for JavaScript applications
210
+
211
+ Powered by LesliTech
212
+ Building a better future, one line of code at a time.
213
+
214
+ @contact <hello@lesli.tech>
215
+ @website <https://lesli.tech>
216
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
217
+
218
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
219
+ // ·
220
+ */
221
+
222
+ /*
223
+ Lesli
224
+
225
+ Copyright (c) 2023, Lesli Technologies, S. A.
226
+
227
+ This program is free software: you can redistribute it and/or modify
228
+ it under the terms of the GNU General Public License as published by
229
+ the Free Software Foundation, either version 3 of the License, or
230
+ (at your option) any later version.
231
+
232
+ This program is distributed in the hope that it will be useful,
233
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
234
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
235
+ GNU General Public License for more details.
236
+
237
+ You should have received a copy of the GNU General Public License
238
+ along with this program. If not, see http://www.gnu.org/licenses/.
239
+
240
+ Lesli · Ruby on Rails SaaS Development Framework.
241
+
242
+ Made with ♥ by https://www.lesli.tech
243
+ Building a better future, one line of code at a time.
244
+
245
+ @contact hello@lesli.tech
246
+ @website https://www.lesli.dev
247
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
248
+
249
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
250
+ // ·
251
+ */
252
+
253
+ /*
254
+ Lesli
255
+
256
+ Copyright (c) 2023, Lesli Technologies, S. A.
257
+
258
+ This program is free software: you can redistribute it and/or modify
259
+ it under the terms of the GNU General Public License as published by
260
+ the Free Software Foundation, either version 3 of the License, or
261
+ (at your option) any later version.
262
+
263
+ This program is distributed in the hope that it will be useful,
264
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
265
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
266
+ GNU General Public License for more details.
267
+
268
+ You should have received a copy of the GNU General Public License
269
+ along with this program. If not, see http://www.gnu.org/licenses/.
270
+
271
+ Lesli · Ruby on Rails SaaS Development Framework.
272
+
273
+ Made with ♥ by https://www.lesli.tech
274
+ Building a better future, one line of code at a time.
275
+
276
+ @contact hello@lesli.tech
277
+ @website https://www.lesli.tech
278
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
279
+
280
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
281
+ // ·
282
+ */
@@ -33,7 +33,8 @@ Building a better future, one line of code at a time.
33
33
 
34
34
  // ·
35
35
  @import "lesli/templates/dashboards";
36
- @import "flag-icon";
36
+ //@import "flag-icons";
37
+
37
38
 
38
39
  // ·
39
40
  .locales {
@@ -1,4 +1,34 @@
1
+ =begin
1
2
 
3
+ Lesli
4
+
5
+ Copyright (c) 2023, Lesli Technologies, S. A.
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 3 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see http://www.gnu.org/licenses/.
19
+
20
+ Lesli · Ruby on Rails SaaS Development Framework.
21
+
22
+ Made with ♥ by https://www.lesli.tech
23
+ Building a better future, one line of code at a time.
24
+
25
+ @contact hello@lesli.tech
26
+ @website https://www.lesli.tech
27
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
+
29
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
+ // ·
31
+ =end
2
32
 
3
33
  module LesliBabel
4
34
  class BucketsController < ApplicationController
@@ -10,7 +40,7 @@ module LesliBabel
10
40
  format.html { }
11
41
  format.json {
12
42
  respond_with_successful(
13
- Module.find(params[:module_id]).buckets.order(name: :asc)
43
+ Module.find(params[:module_id]).buckets.order(:code)
14
44
  )
15
45
  }
16
46
  end
@@ -46,7 +46,7 @@ module LesliBabel
46
46
  def show
47
47
  respond_to do |format|
48
48
  format.html { }
49
- format.json { respond_with_successful(@module) }
49
+ format.json { respond_with_successful(@module.show) }
50
50
  end
51
51
  end
52
52
 
@@ -31,7 +31,7 @@ module LesliBabel
31
31
 
32
32
  if String.find_by(
33
33
  label: string_params[:label],
34
- bucket_id: string_params[:cloud_babel_buckets_id]
34
+ bucket_id: string_params[:bucket_id]
35
35
  )
36
36
  return respond_with_error("Duplicated string")
37
37
  end
@@ -2,21 +2,32 @@
2
2
 
3
3
  Lesli
4
4
 
5
- Copyright (c) 2020, all rights reserved.
5
+ Copyright (c) 2023, Lesli Technologies, S. A.
6
6
 
7
- All the information provided by this platform is protected by international laws related to
8
- industrial property, intellectual property, copyright and relative international laws.
9
- All intellectual or industrial property rights of the code, texts, trade mark, design,
10
- pictures and any other information belongs to the owner of this platform.
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 3 of the License, or
10
+ (at your option) any later version.
11
11
 
12
- Without the written permission of the owner, any replication, modification,
13
- transmission, publication is strictly forbidden.
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
14
16
 
15
- For more information read the license file including with this software.
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see http://www.gnu.org/licenses/.
16
19
 
17
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
18
- // ·
20
+ Lesli · Ruby on Rails SaaS Development Framework.
21
+
22
+ Made with ♥ by https://www.lesli.tech
23
+ Building a better future, one line of code at a time.
19
24
 
25
+ @contact hello@lesli.tech
26
+ @website https://www.lesli.tech
27
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
+
29
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
+ // ·
20
31
  =end
21
32
 
22
33
  module LesliBabel
@@ -79,8 +90,8 @@ module LesliBabel
79
90
 
80
91
  def deploy
81
92
  #TranslationsService.clean
82
- TranslationsRailsService.build
83
- TranslationsService.restart_server
93
+ DeployRailsService.new(current_user, query).build
94
+ #TranslationsService.restart_server
84
95
  respond_with_successful
85
96
  end
86
97
 
@@ -18,18 +18,26 @@ module LesliBabel
18
18
  end
19
19
  end
20
20
 
21
+ def show
22
+ {
23
+ :id => self.id,
24
+ :code => self.code.titleize,
25
+ :platform => self.platform,
26
+ :created_at => self.created_at
27
+ }
28
+ end
29
+
21
30
  def format_module_name
22
31
 
32
+ return if self.code == "main_app"
23
33
  return if self.platform == "lesli_core"
24
34
  return if self.platform == "lesli_engine"
25
35
 
26
- self.name = self.name
36
+ self.code = self.code
27
37
  .gsub(/[^0-9A-Za-z\s\-\_]/, '') # remove special characters from string
28
38
  .gsub(/-/, '') # replace dashes with underscore
29
39
  .gsub(/_/, '') # replace underscore with underscore
30
- .titlecase # Capitalizes all the words
31
40
  .gsub(/\s+/, '') # remove blank spaces
32
41
  end
33
-
34
42
  end
35
43
  end
@@ -217,11 +217,10 @@ module LesliBabel
217
217
  end
218
218
 
219
219
  def path
220
- self[:engine_name]
220
+ self[:engine_code]
221
221
  .downcase
222
- .sub("cloud", "")
223
222
  .concat(".")
224
- .concat(self[:bucket_name])
223
+ .concat(self[:bucket_code])
225
224
  .concat(".")
226
225
  .concat(self[:label])
227
226
  end
@@ -237,7 +236,7 @@ module LesliBabel
237
236
  .gsub(/\s+/, '_') # replace spaces or spaces with single dash
238
237
 
239
238
  self.status = "normal" if self.status.blank?
240
- self.reference_bucket = "#{self.bucket.reference_module}-#{self.bucket.name}"
239
+ self.reference_bucket = "#{self.bucket.reference_module}-#{self.bucket.code}"
241
240
  end
242
241
  end
243
242
  end
@@ -0,0 +1,142 @@
1
+ module LesliBabel
2
+ class DeployRailsService < Lesli::ApplicationLesliService
3
+
4
+ def build
5
+
6
+ Lesli::System.engines.each do |engine, engine_info|
7
+
8
+ # get all rails engines to buil
9
+ engine_id = Module
10
+ .where("platform in ('lesli_core', 'lesli_engine')")
11
+ .where(:code => engine_info[:code])
12
+ .pluck(:id)
13
+
14
+ engine_id_lesli = Module
15
+ .where("platform in ('lesli_core', 'lesli_engine')")
16
+ .where(:code => "lesli")
17
+ .pluck(:id)
18
+
19
+ bucket_id_shared = Bucket
20
+ .where(:code => "shared")
21
+ .where(:module_id => engine_id_lesli)
22
+ .pluck(:id)
23
+
24
+ bucket_id_application = Bucket
25
+ .where(:code => "application")
26
+ .where(:module_id => engine_id_lesli)
27
+ .pluck(:id)
28
+
29
+ # get strings filtered by module (only rails translations)
30
+ strings = StringService.new(current_user, query).list(engine_id)
31
+ strings_shared = StringService.new(current_user, query).list(engine_id_lesli, bucket_id_shared)
32
+ strings_application = StringService.new(current_user, query).list(engine_id_lesli, bucket_id_application)
33
+
34
+ strings = strings.select(
35
+ :id,
36
+ :label,
37
+ :status,
38
+ :context,
39
+ Lesli.config.locales.keys,
40
+ "lesli_babel_modules.id as engine_id",
41
+ "lesli_babel_buckets.id as bucket_id",
42
+ "lesli_babel_buckets.code as bucket_code",
43
+ "lesli_babel_modules.code as engine_code",
44
+ "lesli_babel_modules.platform as platform",
45
+ "'' as path"
46
+ )
47
+
48
+ translations = {}
49
+
50
+ available_locales = Lesli.config.locales.keys
51
+
52
+ # add key for every available language (required by i18n Rails gem)
53
+ available_locales.each do |lang|
54
+ translations[lang] = {
55
+ :file => "",
56
+ :labels => {}
57
+ }
58
+ end
59
+
60
+ engine_code = engine_info[:code]
61
+
62
+ available_locales.each do |lang|
63
+
64
+ # translations path for lesli core
65
+ translations[lang][:file] = "#{engine}::Engine".constantize.root.join(
66
+ "config", "locales", "translations.#{lang}.yml"
67
+ ).to_s
68
+
69
+ # Create a collection of strings for the current module
70
+ strings.each do |string|
71
+
72
+ bucket_code = string[:bucket_code]
73
+
74
+ unless translations[lang][:labels].has_key? engine_code
75
+ translations[lang][:labels][engine_code] = { }
76
+ end
77
+
78
+ unless translations[lang][:labels][engine_code].has_key? bucket_code
79
+ translations[lang][:labels][engine_code][bucket_code] = { }
80
+ end
81
+
82
+ # # send debug message for missing translations
83
+ string[lang] = ":" + string.path + ":" if string[lang].blank?
84
+
85
+ translations[lang][:labels][engine_code][bucket_code][string.label] = string[lang]
86
+
87
+ end
88
+
89
+ # Create a collection of strings for the shared labels of Lesli
90
+ strings_shared.each do |string|
91
+
92
+ unless translations[lang][:labels].has_key? "lesli"
93
+ translations[lang][:labels]["lesli"] = { }
94
+ end
95
+
96
+ unless translations[lang][:labels]["lesli"].has_key? "shared"
97
+ translations[lang][:labels]["lesli"]["shared"] = { }
98
+ end
99
+
100
+ # # send debug message for missing translations
101
+ string[lang] = ":" + string.path + ":" if string[lang].blank?
102
+
103
+ translations[lang][:labels]["lesli"]["shared"][string.label] = string[lang]
104
+ end
105
+
106
+ # Create a collection of strings for the application labels of Lesli
107
+ strings_application.each do |string|
108
+
109
+ unless translations[lang][:labels].has_key? "lesli"
110
+ translations[lang][:labels]["lesli"] = { }
111
+ end
112
+
113
+ unless translations[lang][:labels]["lesli"].has_key? "application"
114
+ translations[lang][:labels]["lesli"]["application"] = { }
115
+ end
116
+
117
+ # # send debug message for missing translations
118
+ string[lang] = ":" + string.path + ":" if string[lang].blank?
119
+
120
+ translations[lang][:labels]["lesli"]["application"][string.label] = string[lang]
121
+ end
122
+
123
+ end
124
+
125
+ translations.each do |lang, translations|
126
+
127
+ # creates folder and subfolders
128
+ FileUtils.makedirs(File.dirname(translations[:file]))
129
+
130
+ # creates translation file for every available language
131
+ translation_file = File.new(translations[:file], "w+")
132
+
133
+ translation_file.write({ "#{lang}": translations[:labels] }.to_yaml)
134
+
135
+ translation_file.close
136
+
137
+ #L2.msg "file added: #{ translations[:file] }"
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
@@ -8,7 +8,7 @@ module LesliBabel
8
8
 
9
9
  # get list of ids of installed engines and available third-party apps
10
10
  Module
11
- .where(:name => babel_modules_names) # -> only installed engines
11
+ .where(:code => babel_modules_names) # -> only installed engines
12
12
  #.or(Module.where.not(:platform => ["rails_core", "rails_builder", "rails_engine"]))
13
13
  .map { |engine| engine.id }
14
14
 
@@ -32,8 +32,8 @@ module LesliBabel
32
32
  Lesli.config.locales.keys,
33
33
  "lesli_babel_modules.id as engine_id",
34
34
  "lesli_babel_buckets.id as bucket_id",
35
- "lesli_babel_buckets.name as bucket_name",
36
- "lesli_babel_modules.name as engine_name",
35
+ "lesli_babel_buckets.code as bucket_code",
36
+ "lesli_babel_modules.code as engine_code",
37
37
  "lesli_babel_modules.platform as platform",
38
38
  "'' as path"
39
39
  )
@@ -34,10 +34,10 @@ Building a better future, one line of code at a time.
34
34
 
35
35
 
36
36
  <p class="menu-label">Modules</p>
37
- <% LesliBabel::Module.all.order(:platform, :name).each do |engine| %>
37
+ <% LesliBabel::Module.all.order(:code).each do |engine| %>
38
38
  <%= navigation_item(
39
39
  lesli_babel.modules_path + "/" + engine.id.to_s,
40
- engine.name.titleize,
41
- "ri-folder-settings-line"
40
+ engine.code.titleize,
41
+ "ri-folder-line"
42
42
  ); %>
43
43
  <% end %>
@@ -0,0 +1,20 @@
1
+ ---
2
+ :en:
3
+ lesli:
4
+ shared:
5
+ view_discussions: Discussions
6
+ button_add_new: Add new
7
+ button_reload: Reload
8
+ view_files: Files
9
+ view_quick_actions: Quick actions
10
+ button_list: List
11
+ button_save: Save
12
+ button_delete: Delete
13
+ button_edit: Edit
14
+ view_status_active: Active
15
+ view_status_inactive: Inactive
16
+ button_settings: Settings
17
+ button_show: Show
18
+ application:
19
+ navigation_logout: Logout
20
+ navigation_my_profile: My profile