lesli_babel 0.3.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,13 +37,13 @@ import { ref, reactive, onMounted, watch, computed, onUnmounted } from "vue"
37
37
 
38
38
 
39
39
  // ·
40
- import { useStrings } from "LesliBabel/stores/strings"
41
- import { useModule } from "LesliBabel/stores/module"
40
+ import { useString } from "LesliBabel/vue/stores/string"
41
+ import { useModule } from "LesliBabel/vue/stores/module"
42
42
 
43
43
 
44
44
  // · implement stores
45
45
  const storeModule = useModule()
46
- const storeString = useStrings()
46
+ const storeString = useString()
47
47
 
48
48
 
49
49
  // ·
@@ -55,12 +55,6 @@ const props = defineProps({
55
55
  })
56
56
 
57
57
 
58
- // ·
59
- onMounted(() => {
60
-
61
- })
62
-
63
-
64
58
  // ·
65
59
  const bucket = ref('')
66
60
  const prefix = ref('')
@@ -68,7 +62,7 @@ const string = ref('')
68
62
 
69
63
 
70
64
  // ·
71
- const prefixes = [{
65
+ const components = [{
72
66
  label: "column",
73
67
  value: "column"
74
68
  }, {
@@ -87,68 +81,45 @@ const prefixes = [{
87
81
  label: "chart",
88
82
  value: "chart"
89
83
  }, {
90
- label: "tab_title",
91
- value: "tab_title"
92
- }, {
93
- label: "table_action",
94
- value: "table_action"
84
+ label: "tab",
85
+ value: "tab"
95
86
  }, {
96
- label: "table_header",
97
- value: "table_header"
98
- }, {
99
- label: "title",
100
- value: "title"
87
+ label: "table",
88
+ value: "table"
101
89
  }, {
102
90
  label: "toolbar",
103
91
  value: "toolbar"
104
92
  }, {
105
93
  label: "view",
106
94
  value: "view"
107
- }, {
108
- label: "view_text",
109
- value: "view_text"
110
- }, {
111
- label: "view_placeholder",
112
- value: "view_placeholder"
113
95
  }]
114
96
 
115
-
116
- function postString() {
117
- storeString.post({
118
- bucket_id: bucket.value,
119
- context: '',
120
- label: prefix.value + "_" + string.value
121
- })
122
-
123
- string.value = ''
124
- }
125
-
126
97
  </script>
127
98
  <template>
128
- <lesli-form @submit="postString">
99
+ <lesli-form @submit="storeString.post()">
129
100
  <div class="card-content">
130
101
  <div class="field">
131
102
  <label class="label">Bucket</label>
132
103
  <div class="control">
133
104
  <lesli-select
134
- v-model="bucket"
105
+ v-model="storeString.string.bucket_id"
135
106
  :options="storeModule.buckets.map(b => { return { value: b.id, label: b.code }})">
136
107
  </lesli-select>
137
108
  </div>
138
109
  </div>
139
110
  <div class="field">
140
- <label class="label">Prefix</label>
111
+ <label class="label">Component</label>
141
112
  <div class="control">
142
113
  <lesli-select
143
- v-model="prefix"
144
- :options="prefixes">
114
+ v-model="storeString.component"
115
+ :options="components">
145
116
  </lesli-select>
146
117
  </div>
147
118
  </div>
148
119
  <div class="field">
149
120
  <label class="label">Label</label>
150
121
  <div class="control">
151
- <input required v-model="string" class="input" type="text" placeholder="Add label to translation workflow" />
122
+ <input required v-model="storeString.string.label" class="input" type="text" placeholder="Add label to translation workflow" />
152
123
  </div>
153
124
  </div>
154
125
  <div class="control">
@@ -0,0 +1,84 @@
1
+ /*
2
+ Copyright (c) 2022, all rights reserved.
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.
8
+
9
+ Without the written permission of the owner, any replication, modification,
10
+ transmission, publication is strictly forbidden.
11
+
12
+ For more information read the license file including with this software.
13
+
14
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
15
+ // ·
16
+ */
17
+
18
+
19
+ // ·
20
+ import { defineStore } from "pinia"
21
+
22
+
23
+ // ·
24
+ export const useString = defineStore("babel.string", {
25
+ state: () => {
26
+ return {
27
+ component: "",
28
+ string: {
29
+ bucket_id: null,
30
+ context: "",
31
+ label: ""
32
+ }
33
+ }
34
+ },
35
+ actions: {
36
+
37
+ updateString(string, locale=false) {
38
+ clearTimeout(this.timer)
39
+ this.timer = setTimeout(() => {
40
+ this.putString(string, locale)
41
+ }, 1500)
42
+ },
43
+
44
+ putString(string, locale=false) {
45
+
46
+ // we need to send only properties that we can update
47
+ let stringToUpdate = {
48
+ status: string.status,
49
+ context: string.context,
50
+ priority: string.priority,
51
+ need_help: string.need_help,
52
+ need_translation: string.need_translation
53
+ }
54
+
55
+ // if locale send then we update only the specific translation
56
+ if (locale) {
57
+ stringToUpdate[locale] = string[locale]
58
+ }
59
+
60
+ this.http.put(this.url.babel("strings/:id", string.id), {
61
+ string: stringToUpdate
62
+ }).then(result => {
63
+ this.msg.success("Translation updated successfully")
64
+ }).catch(error => {
65
+ console.log(error)
66
+ })
67
+ },
68
+
69
+ post() {
70
+ this.http.post(this.url.babel('strings'), {
71
+ string: {
72
+ bucket_id: this.string.bucket_id,
73
+ context: this.string.context,
74
+ label: this.component + "_" + this.string.label
75
+ }
76
+ }).then(result => {
77
+ this.msg.success("Label successfully added")
78
+ this.string.label = ""
79
+ }).finally(() => {
80
+
81
+ })
82
+ }
83
+ }
84
+ })
@@ -1,37 +1,47 @@
1
1
  {
2
2
  "en": {
3
3
  "lesli": {
4
- "shared": {
5
- "title_lesli": ":lesli.shared.title_lesli:"
4
+ "application": {
5
+ "navigation_logout": "Logout",
6
+ "navigation_my_profile": "My profile"
6
7
  },
7
- "users": {
8
- "title_users": "Users"
9
- }
10
- },
11
- "lesli_babel": {
12
8
  "shared": {
13
- "title_lesli": ":lesli.shared.title_lesli:"
14
- },
15
- "users": {
16
- "title_users": "Users"
9
+ "button_add_new": "Add new",
10
+ "button_delete": "Delete",
11
+ "button_edit": "Edit",
12
+ "button_list": "List",
13
+ "button_reload": "Reload",
14
+ "button_save": "Save",
15
+ "button_settings": "Settings",
16
+ "button_show": "Show",
17
+ "view_discussions": "Discussions",
18
+ "view_files": "Files",
19
+ "view_quick_actions": "Quick actions",
20
+ "view_status_active": "Active",
21
+ "view_status_inactive": "Inactive"
17
22
  }
18
23
  }
19
24
  },
20
25
  "es": {
21
26
  "lesli": {
22
- "shared": {
23
- "title_lesli": "Lesli en español "
27
+ "application": {
28
+ "navigation_logout": "Cerrar sesión",
29
+ "navigation_my_profile": "Mi perfil"
24
30
  },
25
- "users": {
26
- "title_users": "Usuarios"
27
- }
28
- },
29
- "lesli_babel": {
30
31
  "shared": {
31
- "title_lesli": "Lesli en español "
32
- },
33
- "users": {
34
- "title_users": "Usuarios"
32
+ "button_add_new": "Agregar nuevo",
33
+ "button_delete": "Eliminar",
34
+ "button_edit": "Editar",
35
+ "button_list": "Lista",
36
+ "button_reload": "Recargar",
37
+ "button_save": "Guardar",
38
+ "button_settings": "Configuración",
39
+ "button_show": "Ver",
40
+ "view_discussions": "Discusiones",
41
+ "view_files": "Archivos",
42
+ "view_quick_actions": "Acciones rapidas",
43
+ "view_status_active": "Activo",
44
+ "view_status_inactive": "Inactivo"
35
45
  }
36
46
  }
37
47
  }
data/readme.md CHANGED
@@ -1,16 +1,17 @@
1
1
  <p align="center">
2
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
+ <h3 align="center">Translation Management System for the Lesli Framework.</h3>
4
4
  </p>
5
5
 
6
6
  <hr/>
7
7
  <p align="center">
8
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">
9
+ <img height="22" alt="Gem Version" src="https://badge.fury.io/rb/lesli_babel.svg" />
10
10
  </a>
11
11
  </p>
12
12
  <hr/>
13
13
 
14
+
14
15
  ### Quick start
15
16
 
16
17
  ```shell
@@ -32,9 +33,9 @@ end
32
33
 
33
34
 
34
35
  ### Documentation
35
- * [Roadmap](./docs/roadmap.md)
36
- * [database](./docs/database.md)
37
- * [documentation](https://www.lesli.dev/documentation/)
36
+ * [Website](https://www.lesli.dev/babel/)
37
+ * [Database](./docs/database.md)
38
+ * [Documentation](https://www.lesli.dev/documentation/)
38
39
 
39
40
 
40
41
  ### Get in touch
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lesli_babel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.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-11-02 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2024-03-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 7.0.6
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 7.0.6
27
+ - !ruby/object:Gem::Dependency
28
+ name: lesli
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5'
13
41
  description: Translation Management System for The Lesli Framework
14
42
  email:
15
43
  - hello@lesli.tech
@@ -22,10 +50,7 @@ files:
22
50
  - app/assets/images/lesli_babel/babel-logo.svg
23
51
  - app/assets/javascripts/lesli_babel/application.js
24
52
  - app/assets/javascripts/lesli_babel/application.js.LICENSE.txt
25
- - app/assets/stylesheets/lesli_babel/application.scss
26
- - app/assets/stylesheets/lesli_babel/dashboards.scss
27
- - app/assets/stylesheets/lesli_babel/modules.scss
28
- - app/assets/stylesheets/lesli_babel/translations.scss
53
+ - app/assets/stylesheets/lesli_babel/application.css
29
54
  - app/controllers/lesli_babel/application_controller.rb
30
55
  - app/controllers/lesli_babel/buckets_controller.rb
31
56
  - app/controllers/lesli_babel/clones_controller.rb
@@ -110,6 +135,10 @@ files:
110
135
  - lib/lesli_babel.rb
111
136
  - lib/lesli_babel/engine.rb
112
137
  - lib/lesli_babel/version.rb
138
+ - lib/scss/application.scss
139
+ - lib/scss/dashboards.scss
140
+ - lib/scss/modules.scss
141
+ - lib/scss/translations.scss
113
142
  - lib/tasks/lesli_babel_tasks.rake
114
143
  - lib/vue/application.js
115
144
  - lib/vue/apps/dashboards/show.vue
@@ -121,6 +150,7 @@ files:
121
150
  - lib/vue/components/form-string-new.vue
122
151
  - lib/vue/stores/module.js
123
152
  - lib/vue/stores/statistics.js
153
+ - lib/vue/stores/string.js
124
154
  - lib/vue/stores/strings.js
125
155
  - lib/vue/stores/translations.js
126
156
  - lib/vue/stores/translations.json
@@ -141,7 +171,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
171
  requirements:
142
172
  - - ">="
143
173
  - !ruby/object:Gem::Version
144
- version: '0'
174
+ version: '2.7'
145
175
  required_rubygems_version: !ruby/object:Gem::Requirement
146
176
  requirements:
147
177
  - - ">="