lesli_babel 1.0.0 → 1.1.1

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.
@@ -65,7 +65,7 @@ module LesliBabel
65
65
 
66
66
  end
67
67
 
68
- Lesli.config.locales.keys.each do |locale|
68
+ I18n.available_locales.each do |locale|
69
69
 
70
70
  # if translation changed
71
71
  if @label[locale] != label_params[locale]
@@ -115,7 +115,7 @@ module LesliBabel
115
115
  :status,
116
116
  :context,
117
117
  :bucket_id,
118
- Lesli.config.locales.keys
118
+ I18n.available_locales
119
119
  )
120
120
  end
121
121
  end
@@ -28,7 +28,7 @@ module LesliBabel
28
28
  :text,
29
29
  :status,
30
30
  :context,
31
- Lesli.config.locales.keys,
31
+ Lesli.config.babel.dig(:locales).keys,
32
32
  "lesli_babel_modules.id as engine_id",
33
33
  "lesli_babel_buckets.id as bucket_id",
34
34
  "lesli_babel_buckets.code as bucket_code",
@@ -12,7 +12,7 @@ module LesliBabel
12
12
  # total translations by language
13
13
  total_strings_translations = []
14
14
 
15
- Lesli.config.locales.each do |locale|
15
+ Lesli.config.babel.dig(:locales).each do |locale|
16
16
  total_strings_translations.push({
17
17
  code: locale[0],
18
18
  name: locale[1],
@@ -69,7 +69,7 @@ module LesliBabel
69
69
 
70
70
  translations = {}
71
71
 
72
- available_locales = Lesli.config.locales.keys
72
+ available_locales = I18n.available_locales
73
73
 
74
74
  # add key for every available language (required by i18n Rails gem)
75
75
  available_locales.each do |lang|
@@ -7,17 +7,21 @@
7
7
 
8
8
  <%= render(LesliView::Components::Toolbar.new) %>
9
9
 
10
- <div class="locales">
11
- <% @stats[:total_strings_translations].each do |locale| %>
12
- <div class="card mr-5 mb-5">
13
- <svg class="flag-icon mb-2" width="64px" height="48px">
14
- <use xlink:href="#locale-<%= locale[:code] %>"></use>
15
- </svg>
16
- <p class="is-size-5"><%= locale[:name] %>: <%= locale[:total] %></p>
17
- <small>missing: <%= @stats[:total_strings].to_i - locale[:total] %> translations</small>
18
- </div>
19
- <% end %>
20
- </div>
10
+ <section class="container">
11
+ <div class="columns is-multiline is-variable dashboard-components">
12
+ <% @stats[:total_strings_translations].each do |locale| %>
13
+ <div class="column">
14
+ <div class="box has-text-centered">
15
+ <svg class="flag-icon mb-2" width="64px" height="48px">
16
+ <use xlink:href="#locale-<%= locale[:code] %>"></use>
17
+ </svg>
18
+ <p class="is-size-5"><%= locale[:name] %>: <%= locale[:total] %></p>
19
+ <small>missing: <%= @stats[:total_strings].to_i - locale[:total] %> translations</small>
20
+ </div>
21
+ </div>
22
+ <% end %>
23
+ </div>
24
+ </section>
21
25
  <% end %>
22
26
 
23
27
  <%# Loading the flags icons from assets %>
@@ -11,7 +11,7 @@
11
11
  <% form.fieldset(label_status, category:label_category) do %>
12
12
 
13
13
  <% if @label.new_record? %>
14
- <%= form.field_control_select(:bucket_id, @module.buckets.pluck(:code, :id)) %>
14
+ <%= form.field_control_select(:bucket_id, @module.buckets.order(:code).pluck(:code, :id)) %>
15
15
  <%= form.field_control_select(:prefix, LesliBabel::Label.prefixes) %>
16
16
  <%= form.field_control(:text) %>
17
17
  <%= form.field_control(:context) %>
@@ -5,9 +5,9 @@ columns = [{
5
5
  }, {
6
6
  label: 'Label to translate',
7
7
  field: 'text'
8
- }, {
9
- label: 'English',
10
- field: 'en'
8
+ #}, {
9
+ # label: 'English',
10
+ # field: 'en'
11
11
  }, {
12
12
  label: 'Path',
13
13
  field: 'path'
@@ -32,9 +32,9 @@ columns = [{
32
32
  <% row.with_cell do %>
33
33
  <%= turbo_link_to(record["text"], label_path(record["id"])) %>
34
34
  <% end %>
35
- <% row.with_cell do %>
36
- <%= turbo_link_to(record["en"] || "", label_path(record["id"])) %>
37
- <% end %>
35
+ <%# row.with_cell do %>
36
+ <%#= turbo_link_to(record["en"] || "", label_path(record["id"])) %>
37
+ <%# end %>
38
38
  <% row.with_cell do %>
39
39
  <div x-data="{ copied: false }">
40
40
  <button
@@ -40,8 +40,8 @@ module LesliBabel
40
40
  config.assets.precompile += %w[lesli_babel_manifest.js]
41
41
 
42
42
  # set locales (from initializer)
43
- config.i18n.default_locale = Lesli.config.locales.keys.first || :en
44
- config.i18n.available_locales = Lesli.config.locales.keys || [:en]
43
+ config.i18n.default_locale = Lesli.config.babel.dig(:locales).keys.first || :en
44
+ config.i18n.available_locales = Lesli.config.babel.dig(:locales).keys || [:en]
45
45
 
46
46
  config.i18n.load_path += Dir["#{Lesli::Engine.root.to_s}/config/locales/*.yml"]
47
47
 
@@ -1,4 +1,4 @@
1
1
  module LesliBabel
2
- VERSION = "1.0.0"
3
- BUILD = "1771710537"
2
+ VERSION = "1.1.1"
3
+ BUILD = "1780272810"
4
4
  end
@@ -77,7 +77,7 @@ namespace :lesli_babel do
77
77
  end
78
78
  end
79
79
 
80
- L2.info('LesliBabel: Module/Controllers scanned and registered')
80
+ Termline.success('LesliBabel: Module/Controllers scanned and registered')
81
81
 
82
82
  end
83
83
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lesli_babel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Lesli Development Team
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '5.0'
18
+ version: 5.1.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: '5.0'
25
+ version: 5.1.0
26
26
  description: "Lesli is a SaaS development framework designed to build highly scalable,
27
27
  \nsecure and customizable software products.\n"
28
28
  email:
@@ -72,25 +72,7 @@ files:
72
72
  - lib/lesli_babel.rb
73
73
  - lib/lesli_babel/engine.rb
74
74
  - lib/lesli_babel/version.rb
75
- - lib/scss/application.scss
76
- - lib/scss/dashboards.scss
77
- - lib/scss/modules.scss
78
- - lib/scss/translations.scss
79
75
  - lib/tasks/lesli_babel_tasks.rake
80
- - lib/vue/application.js
81
- - lib/vue/apps/dashboards/show.vue
82
- - lib/vue/apps/modules/show.vue
83
- - lib/vue/apps/relevants/index.vue
84
- - lib/vue/apps/translations/index.vue
85
- - lib/vue/components/actions.vue
86
- - lib/vue/components/form-label-editor.vue
87
- - lib/vue/components/form-string-new.vue
88
- - lib/vue/stores/module.js
89
- - lib/vue/stores/statistics.js
90
- - lib/vue/stores/string.js
91
- - lib/vue/stores/strings.js
92
- - lib/vue/stores/translations.js
93
- - lib/vue/stores/translations.json
94
76
  - license
95
77
  - readme.md
96
78
  homepage: https://www.lesli.dev/
@@ -1,46 +0,0 @@
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
- // ·
36
- body.lesli-babel.dashboards {
37
- @import "./dashboards";
38
- }
39
-
40
-
41
- // ·
42
- body.cloud_babel-modules,
43
- body.cloud_babel-relevants,
44
- body.cloud_babel-translations {
45
- @import "./translations";
46
- }
@@ -1,56 +0,0 @@
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
- @import "Lesli/scss/templates/dashboards";
36
- //@import "flag-icons";
37
-
38
-
39
- // ·
40
- .locales {
41
- @include lesli-css-flex-columns($column-width: 200px);
42
- justify-content: center;
43
-
44
- .card {
45
- padding: 1.8rem 1rem;
46
- text-align: center;
47
- box-shadow: $lesli-box-shadow;
48
- background-color: white;
49
- border-radius: 4px;
50
-
51
- .flag-icon {
52
- border-radius: 4px;
53
- box-shadow: $lesli-box-shadow;
54
- }
55
- }
56
- }
@@ -1,34 +0,0 @@
1
- /*
2
-
3
- Copyright (c) 2020, all rights reserved.
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.
9
-
10
- Without the written permission of the owner, any replication, modification,
11
- transmission, publication is strictly forbidden.
12
-
13
- For more information read the license file including with this software.
14
-
15
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
- // ·
17
-
18
- */
19
-
20
- /*
21
- // ·
22
- @import "templates/component";
23
-
24
-
25
- // ·
26
- .card {
27
- margin-bottom: 1.2rem;
28
- }
29
-
30
-
31
- .pagination-link {
32
- justify-content: center;
33
- }
34
- */
@@ -1,59 +0,0 @@
1
- /*
2
-
3
- Copyright (c) 2020, all rights reserved.
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.
9
-
10
- Without the written permission of the owner, any replication, modification,
11
- transmission, publication is strictly forbidden.
12
-
13
- For more information read the license file including with this software.
14
-
15
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
- // ·
17
- */
18
-
19
-
20
-
21
- // ·
22
- @import "Lesli/scss/templates/component";
23
-
24
-
25
- // ·
26
- #babel-translations {
27
-
28
- tbody td {
29
- padding: 0rem 1rem;
30
- height: 60px;
31
- input.input {
32
- height: 60px;
33
- border: none;
34
- box-shadow: none;
35
- border-radius: 3px;
36
- background-color: transparent;
37
- &::placeholder {
38
- color: lesli-css-color(silver, 900);
39
- }
40
- }
41
-
42
- &.detail-row {
43
- padding-left: 1rem !important;
44
- }
45
- }
46
-
47
- .copied:after{
48
- display: inline;
49
- position: absolute;
50
- content: "Label copied to clipboard!";
51
- animation: 1s ease-in-out 0s 1 normal forwards running copyit;
52
- font-size: .8em;
53
- }
54
-
55
- @keyframes copyit{
56
- 0%{ bottom:2em;opacity:1;}
57
- 100%{bottom:4em;opacity:0;}
58
- }
59
- }
@@ -1,69 +0,0 @@
1
- /*
2
- Lesli
3
-
4
- Copyright (c) 2023, Lesli Technologies, S. A.
5
-
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.
10
-
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.
15
-
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
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
29
- // ·
30
- */
31
-
32
-
33
- // · Import Lesli builders
34
- import application from "Lesli/vue/application"
35
- import translation from "Lesli/vue/translation"
36
-
37
-
38
- // · Import engine translations
39
- import translations from "LesliBabel/vue/stores/translations.json"
40
-
41
-
42
- // ·
43
- import appDashboardShow from "LesliBabel/vue/apps/dashboards/show.vue"
44
- import appRelevantsIndex from "LesliBabel/vue/apps/relevants/index.vue"
45
- import appTranslationsIndex from "LesliBabel/vue/apps/translations/index.vue"
46
- import appModulesShow from "LesliBabel/vue/apps/modules/show.vue"
47
-
48
-
49
- // · Buil Lesli translations
50
- translation(translations)
51
-
52
-
53
- // ·
54
- application("LesliBabel", [{
55
- path: "/",
56
- component: appDashboardShow
57
- }, {
58
- path: "/dashboard",
59
- component: appDashboardShow
60
- }, {
61
- path: "/translations",
62
- component: appTranslationsIndex
63
- }, {
64
- path: "/relevants",
65
- component: appRelevantsIndex
66
- }, {
67
- path: "/modules/:id",
68
- component: appModulesShow
69
- }])
@@ -1,83 +0,0 @@
1
- <script setup>
2
- /*
3
- Copyright (c) 2022, all rights reserved.
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.
9
-
10
- Without the written permission of the owner, any replication, modification,
11
- transmission, publication is strictly forbidden.
12
-
13
- For more information read the license file including with this software.
14
-
15
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
- // ·
17
- */
18
-
19
-
20
- // · import vue tools
21
- import { ref, reactive, onMounted, watch, computed, inject } from "vue"
22
- import { useRouter, useRoute } from 'vue-router'
23
-
24
-
25
- // · Import components
26
- import componentActions from "LesliBabel/vue/components/actions.vue"
27
-
28
-
29
- // · initialize/inject plugins
30
- const router = useRouter()
31
- const msg = inject("msg")
32
- const url = inject("url")
33
-
34
-
35
- // · import lesli stores
36
- import { useStatistics } from "LesliBabel/vue/stores/statistics"
37
- import { useStrings } from "LesliBabel/vue/stores/strings"
38
-
39
-
40
- // · implement stores
41
- const storeStatistics = useStatistics()
42
- const storeStrings = useStrings()
43
-
44
-
45
- // ·
46
- onMounted(() => {
47
- storeStatistics.fetch()
48
- })
49
-
50
-
51
- // ·
52
- function flag(language) {
53
- if (language == 'en') { return 'flag-icon-gb' }
54
- if (language == 'uk') { return 'flag-icon-ua' }
55
- return 'flag-icon-'+language
56
- }
57
-
58
-
59
- // ·
60
- function search(string) {
61
- router.push({ path: "translations", query: { search: string }})
62
- }
63
- </script>
64
- <template>
65
- <lesli-application-container>
66
- <lesli-header :title="`Found ${ storeStatistics.totalStrings } registered labels`">
67
- <component-actions></component-actions>
68
- </lesli-header>
69
- <lesli-toolbar @search="search"></lesli-toolbar>
70
- <div class="locales">
71
- <router-link class="card mr-5 mb-5"
72
- v-for="locale in storeStatistics.languages"
73
- :key="locale.code"
74
- :to="url.babel('translations', { locale: locale.code }).toString()" >
75
- <svg class="flag-icon mb-2" width="64px" height="48px">
76
- <use v-bind:xlink:href="'#locale-'+locale.code"></use>
77
- </svg>
78
- <p class="is-size-5">{{ locale.name }}: {{ locale.total }}</p>
79
- <small>missing: {{ storeStatistics.totalStrings - locale.total }} translations</small>
80
- </router-link>
81
- </div>
82
- </lesli-application-container>
83
- </template>
@@ -1,106 +0,0 @@
1
- <script setup>
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
- // · import vue tools
35
- import { ref, reactive, onMounted, watch, computed, onUnmounted } from "vue"
36
- import { useRouter, useRoute } from 'vue-router'
37
-
38
-
39
- // · import components
40
- import formStringNew from "LesliBabel/vue/components/form-string-new.vue"
41
- import formLabelEditor from "LesliBabel/vue/components/form-label-editor.vue"
42
- import componentActions from "LesliBabel/vue/components/actions.vue"
43
-
44
-
45
- // · import lesli stores
46
- import { useModule } from "LesliBabel/vue/stores/module"
47
- import { useStrings } from "LesliBabel/vue/stores/strings"
48
-
49
-
50
- // · implement stores
51
- const storeModule = useModule()
52
- const storeStrings = useStrings()
53
- const router = useRouter()
54
- const route = useRoute()
55
-
56
-
57
- // ·
58
- onMounted(() => {
59
- storeModule.fetchModule(route.params.id)
60
- })
61
-
62
-
63
- // ·
64
- function getModule() {
65
- return route.params?.id
66
- }
67
-
68
-
69
- // ·
70
- function search(string) {
71
- router.push({ query: { search: string }})
72
- }
73
-
74
-
75
- // ·
76
- watch(() => route.params.id, () => {
77
- storeModule.fetchModule(route.params.id)
78
- })
79
-
80
- </script>
81
- <template>
82
- <lesli-application-container>
83
- <lesli-header :title="storeModule.code">
84
- <component-actions></component-actions>
85
- <lesli-button main icon="add" @click="storeStrings.showPanel = true">
86
- add new string
87
- </lesli-button>
88
- </lesli-header>
89
-
90
- <lesli-toolbar @search="search">
91
- </lesli-toolbar>
92
-
93
- <formLabelEditor :module="getModule()">
94
- </formLabelEditor>
95
-
96
- <lesli-panel v-model:open="storeStrings.showPanel">
97
- <template #header>
98
- Add new string to translate
99
- </template>
100
- <template #default>
101
- <formStringNew v-if="storeModule.id" :module-id="storeModule.id">
102
- </formStringNew>
103
- </template>
104
- </lesli-panel>
105
- </lesli-application-container>
106
- </template>