lesli_babel 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,8 +30,8 @@ Building a better future, one line of code at a time.
30
30
  // ·
31
31
  =end
32
32
 
33
+ # ·
33
34
  require "json"
34
-
35
35
  namespace :lesli_babel do
36
36
 
37
37
  desc "Delete translations files"
@@ -45,7 +45,7 @@ namespace :lesli_babel do
45
45
  end
46
46
 
47
47
  desc "Create standard structure for translations according to the objects in the app"
48
- task scan: [:environment] do
48
+ task build: [:environment] do
49
49
 
50
50
  engines = Lesli::SystemController.index(matrix: false)
51
51
 
@@ -53,11 +53,12 @@ namespace :lesli_babel do
53
53
 
54
54
  platform = "lesli_engine"
55
55
  platform = "lesli_core" if t[:engine] == "lesli"
56
+ platform = "rails_app" if t[:engine] == "app"
56
57
 
57
58
  # add object to the translation workflow
58
- translation_module = LesliBabel::Module.find_or_create_by(name: t[:engine], platform: platform)
59
- translation_bucket = LesliBabel::Bucket.find_or_create_by(name: t[:controller], module: translation_module, reference_module: translation_module.name)
60
- translation_bucket = LesliBabel::Bucket.find_or_create_by({ name: "shared", module: translation_module, reference_module: translation_module.name })
59
+ translation_module = LesliBabel::Module.find_or_create_by(code: t[:engine], platform: platform)
60
+ translation_bucket = LesliBabel::Bucket.find_or_create_by(code: t[:route].sub(t[:engine]+"/", ""), module: translation_module, reference_module: translation_module.code)
61
+ translation_bucket = LesliBabel::Bucket.find_or_create_by(code: "shared", module: translation_module, reference_module: translation_module.code)
61
62
 
62
63
  end
63
64
 
@@ -65,57 +66,38 @@ namespace :lesli_babel do
65
66
 
66
67
  end
67
68
 
68
- desc "Scan for descriptors and register labels for translations for them"
69
- task descriptors: [:environment] do
70
-
71
- puts "scan for descriptors"
72
-
73
- translation_module = CloudBabel::Module.find_or_create_by({ name: "Core", platform: "rails_core" })
74
- translation_bucket = CloudBabel::Bucket.find_or_create_by({
75
- name: "descriptors",
76
- module: translation_module,
77
- reference_module: translation_module.name
78
- })
79
-
80
- Descriptor.all.each do |descriptor|
81
- CloudBabel::String.find_or_create_by({
82
- :label => "descriptor_#{descriptor["name"]}",
83
- :bucket => translation_bucket
84
- })
85
- end
86
-
87
-
88
- end
89
-
90
- def scan_for_engines
91
- controller_list = {}
92
-
93
- Rails.application.routes.routes.each do |route|
94
- route = route.defaults
95
-
96
- next if route[:controller].blank?
97
- next if route[:controller].include? "rails"
98
- next if route[:controller].include? "action_mailbox"
99
- next if route[:controller].include? "active_storage"
100
-
101
- controller_list[route[:controller]] = [] unless controller_list[route[:controller]]
102
-
103
- controller_list[route[:controller]].push(route[:action])
104
- end
105
69
 
106
- Rails.configuration.lesli.dig(:engines).each do |engine|
107
- platform = "rails_engine"
108
- platform = "rails_builder" if engine[:type] == "builder"
109
- routes = "#{engine[:name]}::Engine".constantize.routes.routes.each do |route|
110
- route = route.defaults
111
-
112
- controller_list[route[:controller]] = [] if controller_list[route[:controller]].blank?
113
-
114
- controller_list[route[:controller]].push(route[:action])
115
-
116
- end
70
+ desc "Export translations to json files"
71
+ task :export => :environment do |task, args|
72
+
73
+ Lesli::System.engines.each do |engine, engine_info|
74
+ # You can provide the config directly using the following
75
+ config = {
76
+ "translations"=> [
77
+ {
78
+ "file"=>"engines/#{engine}/lib/vue/stores/translations.json",
79
+ "patterns"=>[
80
+ "*.#{engine_info[:code]}",
81
+ "*.lesli.*",
82
+ "!*.date",
83
+ "!*.devise",
84
+ "!*.faker",
85
+ "!*.flash",
86
+ "!*.helpers",
87
+ "!*.number",
88
+ "!*.views",
89
+ "!*.time",
90
+ "!*.support",
91
+ "!*.i18n",
92
+ "!*.activerecord",
93
+ "!*.errors",
94
+ "!*.number.nth"
95
+ ]
96
+ }
97
+ ]
98
+ }
99
+
100
+ pp I18nJS.call(config: config)
117
101
  end
118
-
119
- return controller_list
120
- end
102
+ end
121
103
  end
@@ -1,17 +1,31 @@
1
1
  /*
2
- Copyright (c) 2020, all rights reserved.
2
+ Lesli
3
3
 
4
- All the information provided by this platform is protected by international laws related to
5
- industrial property, intellectual property, copyright and relative international laws.
6
- All intellectual or industrial property rights of the code, texts, trade mark, design,
7
- pictures and any other information belongs to the owner of this platform.
4
+ Copyright (c) 2023, Lesli Technologies, S. A.
8
5
 
9
- Without the written permission of the owner, any replication, modification,
10
- transmission, publication is strictly forbidden.
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
11
10
 
12
- For more information read the license file including with this software.
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
13
15
 
14
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see http://www.gnu.org/licenses/.
18
+
19
+ Lesli · Ruby on Rails SaaS Development Framework.
20
+
21
+ Made with ♥ by https://www.lesli.tech
22
+ Building a better future, one line of code at a time.
23
+
24
+ @contact hello@lesli.tech
25
+ @website https://www.lesli.tech
26
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
27
+
28
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
15
29
  // ·
16
30
  */
17
31
 
@@ -1,18 +1,32 @@
1
1
  <script setup>
2
2
  /*
3
- Copyright (c) 2022, all rights reserved.
3
+ Lesli
4
4
 
5
- All the information provided by this platform is protected by international laws related to
6
- industrial property, intellectual property, copyright and relative international laws.
7
- All intellectual or industrial property rights of the code, texts, trade mark, design,
8
- pictures and any other information belongs to the owner of this platform.
5
+ Copyright (c) 2023, Lesli Technologies, S. A.
9
6
 
10
- Without the written permission of the owner, any replication, modification,
11
- transmission, publication is strictly forbidden.
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.
12
11
 
13
- For more information read the license file including with this software.
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
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
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
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
30
  // ·
17
31
  */
18
32
 
@@ -66,7 +80,7 @@ watch(() => route.params.id, () => {
66
80
  </script>
67
81
  <template>
68
82
  <lesli-application-container>
69
- <lesli-header :title="storeModule.name">
83
+ <lesli-header :title="storeModule.code">
70
84
  <component-actions></component-actions>
71
85
  <lesli-button solid icon="add" @click="storeStrings.showPanel = true">
72
86
  add new string
@@ -132,7 +132,7 @@ function postString() {
132
132
  <div class="control">
133
133
  <lesli-select
134
134
  v-model="bucket"
135
- :options="storeModule.buckets.map(b => { return { value: b.id, label: b.name }})">
135
+ :options="storeModule.buckets.map(b => { return { value: b.id, label: b.code }})">
136
136
  </lesli-select>
137
137
  </div>
138
138
  </div>
@@ -1,17 +1,31 @@
1
1
  /*
2
- Copyright (c) 2022, all rights reserved.
2
+ Lesli
3
3
 
4
- All the information provided by this platform is protected by international laws related to
5
- industrial property, intellectual property, copyright and relative international laws.
6
- All intellectual or industrial property rights of the code, texts, trade mark, design,
7
- pictures and any other information belongs to the owner of this platform.
4
+ Copyright (c) 2023, Lesli Technologies, S. A.
8
5
 
9
- Without the written permission of the owner, any replication, modification,
10
- transmission, publication is strictly forbidden.
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
11
10
 
12
- For more information read the license file including with this software.
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
13
15
 
14
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see http://www.gnu.org/licenses/.
18
+
19
+ Lesli · Ruby on Rails SaaS Development Framework.
20
+
21
+ Made with ♥ by https://www.lesli.tech
22
+ Building a better future, one line of code at a time.
23
+
24
+ @contact hello@lesli.tech
25
+ @website https://www.lesli.tech
26
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
27
+
28
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
15
29
  // ·
16
30
  */
17
31
 
@@ -25,7 +39,7 @@ export const useModule = defineStore("babel.module", {
25
39
  state: () => {
26
40
  return {
27
41
  id: 0,
28
- name: "",
42
+ code: "",
29
43
  platform: "",
30
44
  buckets: []
31
45
  }
@@ -35,7 +49,7 @@ export const useModule = defineStore("babel.module", {
35
49
  if (!modulo) return;
36
50
  this.http.get(this.url.babel("modules/:id", modulo)).then(result => {
37
51
  this.id = result.id
38
- this.name = result.name
52
+ this.code = result.code
39
53
  this.platform = result.platform
40
54
  this.fetchBuckets()
41
55
  })
@@ -39,7 +39,7 @@ export const useTranslations = defineStore("babel.translations", {
39
39
  },
40
40
  postDeploy() {
41
41
  this.http.post(this.url.babel("translations/deploy")).then(result => {
42
- this.msg.success("Translations deployed")
42
+ this.msg.success("Deploy successfully")
43
43
  })
44
44
  },
45
45
  postSync() {
@@ -0,0 +1,38 @@
1
+ {
2
+ "en": {
3
+ "lesli": {
4
+ "shared": {
5
+ "title_lesli": ":lesli.shared.title_lesli:"
6
+ },
7
+ "users": {
8
+ "title_users": "Users"
9
+ }
10
+ },
11
+ "lesli_babel": {
12
+ "shared": {
13
+ "title_lesli": ":lesli.shared.title_lesli:"
14
+ },
15
+ "users": {
16
+ "title_users": "Users"
17
+ }
18
+ }
19
+ },
20
+ "es": {
21
+ "lesli": {
22
+ "shared": {
23
+ "title_lesli": "Lesli en español "
24
+ },
25
+ "users": {
26
+ "title_users": "Usuarios"
27
+ }
28
+ },
29
+ "lesli_babel": {
30
+ "shared": {
31
+ "title_lesli": "Lesli en español "
32
+ },
33
+ "users": {
34
+ "title_users": "Usuarios"
35
+ }
36
+ }
37
+ }
38
+ }
data/readme.md CHANGED
@@ -1,19 +1,71 @@
1
1
  <p align="center">
2
- <img width="100" alt="LesliBabel logo" src="app/assets/images/lesli_babel/babel-logo.svg" />
2
+ <img width="75" alt="LesliBabel logo" src="./app/assets/images/lesli_babel/babel-logo.svg" />
3
+ <h3 align="center">Babel - Translation Management System for the Lesli Framework.</h3>
3
4
  </p>
4
5
 
5
- <h3 align="center">LesliBabel - Translation management system</h3>
6
-
7
6
  <hr/>
7
+ <p align="center">
8
+ <a target="blank" href="https://rubygems.org/gems/lesli_babel">
9
+ <img src="https://badge.fury.io/rb/lesli_babel.svg" alt="Gem Version" height="24">
10
+ </a>
11
+ </p>
12
+ <hr/>
13
+
14
+ ### Quick start
15
+
16
+ ```shell
17
+ # Add LesliBabel engine
18
+ bundle add lesli_babel
19
+ ```
20
+
21
+ ```shell
22
+ # Setup database
23
+ rake lesli:db:setup
24
+ ```
25
+
26
+ ```ruby
27
+ # Load LesliBabel
28
+ Rails.application.routes.draw do
29
+ mount LesliBabel::Engine => "/babel"
30
+ end
31
+ ```
32
+
33
+
34
+ ### Documentation
35
+ * [Roadmap](./docs/roadmap.md)
36
+ * [database](./docs/database.md)
37
+ * [documentation](https://www.lesli.dev/documentation/)
8
38
 
9
- Version 5.0
10
39
 
11
- ### License
12
- ------
13
- Software developed in [Guatemala](http://visitguatemala.com/) by [LesliTech](https://www.lesli.tech) distributed under the *General Public License v 3.0* you can read the full license [here](http://www.gnu.org/licenses/gpl-3.0.html)
40
+ ### Get in touch
14
41
 
15
- <br>
42
+ * [Website: https://www.lesli.tech](https://www.lesli.tech)
43
+ * [Email: hello@lesli.tech](hello@lesli.tech)
44
+ * [Twitter: @LesliTech](https://twitter.com/LesliTech)
45
+
46
+
47
+ ### License
48
+ -------
49
+ Copyright (c) 2023, Lesli Technologies, S. A.
50
+
51
+ This program is free software: you can redistribute it and/or modify
52
+ it under the terms of the GNU General Public License as published by
53
+ the Free Software Foundation, either version 3 of the License, or
54
+ (at your option) any later version.
55
+
56
+ This program is distributed in the hope that it will be useful,
57
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
58
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59
+ GNU General Public License for more details.
60
+
61
+ You should have received a copy of the GNU General Public License
62
+ along with this program. If not, see http://www.gnu.org/licenses/.
63
+
64
+ <hr />
65
+ <br />
16
66
 
17
67
  <p align="center">
18
- <img alt="Lesli logo" width="100" src="./app/assets/images/lesli/brand/app-icon.svg" />
68
+ <img width="200" alt="Lesli logo" src="https://cdn.lesli.tech/lesli/brand/app-logo.svg" />
69
+ <h4 align="center">Ruby on Rails SaaS Development Framework.</h4>
19
70
  </p>
71
+
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lesli_babel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.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: 2023-10-06 00:00:00.000000000 Z
11
+ date: 2023-11-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Translation management system for the Lesli Framework
13
+ description: Translation Management System for The Lesli Framework
14
14
  email:
15
15
  - hello@lesli.tech
16
16
  executables: []
@@ -21,6 +21,7 @@ files:
21
21
  - app/assets/config/lesli_babel_manifest.js
22
22
  - app/assets/images/lesli_babel/babel-logo.svg
23
23
  - app/assets/javascripts/lesli_babel/application.js
24
+ - app/assets/javascripts/lesli_babel/application.js.LICENSE.txt
24
25
  - app/assets/stylesheets/lesli_babel/application.scss
25
26
  - app/assets/stylesheets/lesli_babel/dashboards.scss
26
27
  - app/assets/stylesheets/lesli_babel/modules.scss
@@ -45,6 +46,7 @@ files:
45
46
  - app/models/lesli_babel/string/activity.rb
46
47
  - app/models/lesli_babel/string/discussion.rb
47
48
  - app/models/lesli_babel/translation.rb
49
+ - app/services/lesli_babel/deploy_rails_service.rb
48
50
  - app/services/lesli_babel/module_service.rb
49
51
  - app/services/lesli_babel/old/translations_android_service.rb
50
52
  - app/services/lesli_babel/old/translations_clone_service.rb
@@ -99,6 +101,8 @@ files:
99
101
  - app/views/lesli_babel/translations/index.html.erb
100
102
  - app/views/lesli_babel/translations/new.html.erb
101
103
  - app/views/lesli_babel/translations/show.html.erb
104
+ - config/locales/translations.en.yml
105
+ - config/locales/translations.es.yml
102
106
  - config/routes.rb
103
107
  - db/migrate/v1.0/0901100110_create_lesli_babel_modules.rb
104
108
  - db/migrate/v1.0/0901110110_create_lesli_babel_buckets.rb
@@ -119,10 +123,12 @@ files:
119
123
  - lib/vue/stores/statistics.js
120
124
  - lib/vue/stores/strings.js
121
125
  - lib/vue/stores/translations.js
126
+ - lib/vue/stores/translations.json
122
127
  - license
123
128
  - readme.md
124
129
  homepage: https://www.lesli.dev/
125
- licenses: []
130
+ licenses:
131
+ - GPL-3.0
126
132
  metadata:
127
133
  homepage_uri: https://www.lesli.dev/
128
134
  source_code_uri: https://github.com/LesliTech/LesliBabel
@@ -145,5 +151,5 @@ requirements: []
145
151
  rubygems_version: 3.3.7
146
152
  signing_key:
147
153
  specification_version: 4
148
- summary: Translation management system for the Lesli Framework
154
+ summary: Translation Management System for The Lesli Framework
149
155
  test_files: []