lesli_babel 0.1.0
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.
- checksums.yaml +7 -0
- data/Rakefile +5 -0
- data/app/assets/config/lesli_babel_manifest.js +7 -0
- data/app/assets/images/lesli_babel/babel-logo.svg +157 -0
- data/app/assets/javascripts/lesli_babel/application.js +3288 -0
- data/app/assets/stylesheets/lesli_babel/application.scss +41 -0
- data/app/assets/stylesheets/lesli_babel/dashboards.scss +55 -0
- data/app/assets/stylesheets/lesli_babel/modules.scss +33 -0
- data/app/assets/stylesheets/lesli_babel/translations.scss +58 -0
- data/app/controllers/lesli_babel/application_controller.rb +37 -0
- data/app/controllers/lesli_babel/buckets_controller.rb +79 -0
- data/app/controllers/lesli_babel/clones_controller.rb +80 -0
- data/app/controllers/lesli_babel/dashboards_controller.rb +38 -0
- data/app/controllers/lesli_babel/modules_controller.rb +91 -0
- data/app/controllers/lesli_babel/relevants_controller.rb +38 -0
- data/app/controllers/lesli_babel/strings_controller.rb +142 -0
- data/app/controllers/lesli_babel/translations_controller.rb +134 -0
- data/app/jobs/lesli_babel/application_job.rb +7 -0
- data/app/mailers/lesli_babel/application_mailer.rb +6 -0
- data/app/models/lesli_babel/application_record.rb +36 -0
- data/app/models/lesli_babel/bucket.rb +6 -0
- data/app/models/lesli_babel/clone.rb +24 -0
- data/app/models/lesli_babel/dashboard.rb +35 -0
- data/app/models/lesli_babel/module.rb +35 -0
- data/app/models/lesli_babel/relevant.rb +21 -0
- data/app/models/lesli_babel/string/activity.rb +5 -0
- data/app/models/lesli_babel/string/discussion.rb +68 -0
- data/app/models/lesli_babel/string.rb +225 -0
- data/app/models/lesli_babel/translation.rb +5 -0
- data/app/services/lesli_babel/module_service.rb +18 -0
- data/app/services/lesli_babel/old/translations_android_service.rb +82 -0
- data/app/services/lesli_babel/old/translations_clone_service.rb +161 -0
- data/app/services/lesli_babel/old/translations_flutter_service.rb +102 -0
- data/app/services/lesli_babel/old/translations_ios_service.rb +119 -0
- data/app/services/lesli_babel/old/translations_js_service.rb +114 -0
- data/app/services/lesli_babel/old/translations_middleman_service.rb +77 -0
- data/app/services/lesli_babel/old/translations_rails_service.rb +119 -0
- data/app/services/lesli_babel/old/translations_service.rb +97 -0
- data/app/services/lesli_babel/old/translations_synchronization_service.rb +215 -0
- data/app/services/lesli_babel/string_service.rb +80 -0
- data/app/views/lesli_babel/buckets/_form.html.erb +17 -0
- data/app/views/lesli_babel/buckets/edit.html.erb +6 -0
- data/app/views/lesli_babel/buckets/index.html.erb +25 -0
- data/app/views/lesli_babel/buckets/new.html.erb +5 -0
- data/app/views/lesli_babel/buckets/show.html.erb +4 -0
- data/app/views/lesli_babel/clones/_form.html.erb +19 -0
- data/app/views/lesli_babel/clones/edit.html.erb +20 -0
- data/app/views/lesli_babel/clones/index.html.erb +20 -0
- data/app/views/lesli_babel/clones/new.html.erb +20 -0
- data/app/views/lesli_babel/clones/show.html.erb +20 -0
- data/app/views/lesli_babel/dashboards/show.html.erb +1 -0
- data/app/views/lesli_babel/dashboards/stats..html.erb +1 -0
- data/app/views/lesli_babel/modules/_form.html.erb +17 -0
- data/app/views/lesli_babel/modules/edit.html.erb +1 -0
- data/app/views/lesli_babel/modules/index.html.erb +1 -0
- data/app/views/lesli_babel/modules/new.html.erb +1 -0
- data/app/views/lesli_babel/modules/show.html.erb +1 -0
- data/app/views/lesli_babel/partials/_engine-navigation.html.erb +37 -0
- data/app/views/lesli_babel/partials/_engine-sidebar.html.erb +45 -0
- data/app/views/lesli_babel/relevants/edit.html.erb +20 -0
- data/app/views/lesli_babel/relevants/index.html.erb +21 -0
- data/app/views/lesli_babel/relevants/new.html.erb +20 -0
- data/app/views/lesli_babel/relevants/show.html.erb +20 -0
- data/app/views/lesli_babel/string/activities/_form.html.erb +17 -0
- data/app/views/lesli_babel/string/activities/edit.html.erb +6 -0
- data/app/views/lesli_babel/string/activities/index.html.erb +25 -0
- data/app/views/lesli_babel/string/activities/new.html.erb +5 -0
- data/app/views/lesli_babel/string/activities/show.html.erb +4 -0
- data/app/views/lesli_babel/string/discussions/_form.html.erb +17 -0
- data/app/views/lesli_babel/string/discussions/edit.html.erb +6 -0
- data/app/views/lesli_babel/string/discussions/index.html.erb +25 -0
- data/app/views/lesli_babel/string/discussions/new.html.erb +5 -0
- data/app/views/lesli_babel/string/discussions/show.html.erb +4 -0
- data/app/views/lesli_babel/strings/_form.html.erb +17 -0
- data/app/views/lesli_babel/strings/edit.html.erb +6 -0
- data/app/views/lesli_babel/strings/index.html.erb +25 -0
- data/app/views/lesli_babel/strings/new.html.erb +5 -0
- data/app/views/lesli_babel/strings/show.html.erb +4 -0
- data/app/views/lesli_babel/translations/_form.html.erb +17 -0
- data/app/views/lesli_babel/translations/edit.html.erb +6 -0
- data/app/views/lesli_babel/translations/index.html.erb +1 -0
- data/app/views/lesli_babel/translations/new.html.erb +5 -0
- data/app/views/lesli_babel/translations/show.html.erb +1 -0
- data/config/routes.rb +63 -0
- data/db/migrate/v1.0/0901100110_create_lesli_babel_modules.rb +42 -0
- data/db/migrate/v1.0/0901110110_create_lesli_babel_buckets.rb +43 -0
- data/db/migrate/v1.0/0901120110_create_lesli_babel_strings.rb +80 -0
- data/lib/lesli_babel/engine.rb +54 -0
- data/lib/lesli_babel/version.rb +3 -0
- data/lib/lesli_babel.rb +6 -0
- data/lib/tasks/lesli_babel_tasks.rake +121 -0
- data/lib/vue/application.js +46 -0
- data/lib/vue/apps/dashboards/show.vue +85 -0
- data/lib/vue/apps/modules/show.vue +97 -0
- data/lib/vue/apps/relevants/index.vue +47 -0
- data/lib/vue/apps/translations/index.vue +64 -0
- data/lib/vue/components/actions.vue +29 -0
- data/lib/vue/components/form-label-editor.vue +439 -0
- data/lib/vue/components/form-string-new.vue +171 -0
- data/lib/vue/stores/module.js +49 -0
- data/lib/vue/stores/statistics.js +42 -0
- data/lib/vue/stores/strings.js +141 -0
- data/lib/vue/stores/translations.js +73 -0
- data/license +674 -0
- data/readme.md +19 -0
- metadata +149 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
=begin
|
|
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
|
|
32
|
+
|
|
33
|
+
class CreateLesliBabelStrings < ActiveRecord::Migration[6.0]
|
|
34
|
+
def change
|
|
35
|
+
create_table :lesli_babel_strings do |t|
|
|
36
|
+
|
|
37
|
+
t.string :label
|
|
38
|
+
t.string :es # spanish
|
|
39
|
+
t.string :en # english
|
|
40
|
+
t.string :de # deutsch/german
|
|
41
|
+
t.string :fr # french
|
|
42
|
+
t.string :nl # nederlands/netherlands/holanda
|
|
43
|
+
t.string :pl # polski/polish/poland
|
|
44
|
+
t.string :pt # portuguese
|
|
45
|
+
t.string :it # italian
|
|
46
|
+
t.string :tr # turkish
|
|
47
|
+
t.string :ro # romanian
|
|
48
|
+
t.string :bg # bulgarian
|
|
49
|
+
t.string :uk # Ukrainian
|
|
50
|
+
t.string :sr # Serbian
|
|
51
|
+
t.string :hr # Hrvatski/Croatian
|
|
52
|
+
|
|
53
|
+
t.integer :status # 0 disabled, 1 ok, 2 need help, 3 need translation
|
|
54
|
+
t.string :context
|
|
55
|
+
|
|
56
|
+
t.datetime :last_update_es
|
|
57
|
+
t.datetime :last_update_en
|
|
58
|
+
t.datetime :last_update_de
|
|
59
|
+
t.datetime :last_update_fr
|
|
60
|
+
t.datetime :last_update_nl
|
|
61
|
+
t.datetime :last_update_pl
|
|
62
|
+
t.datetime :last_update_pt
|
|
63
|
+
t.datetime :last_update_it
|
|
64
|
+
t.datetime :last_update_tr
|
|
65
|
+
t.datetime :last_update_ro
|
|
66
|
+
t.datetime :last_update_bg
|
|
67
|
+
t.datetime :last_update_uk
|
|
68
|
+
t.datetime :last_update_sr
|
|
69
|
+
t.datetime :last_update_hr
|
|
70
|
+
|
|
71
|
+
t.datetime :last_update_status
|
|
72
|
+
t.datetime :last_update_context
|
|
73
|
+
|
|
74
|
+
t.string :reference_bucket
|
|
75
|
+
t.datetime :deleted_at
|
|
76
|
+
t.timestamps
|
|
77
|
+
end
|
|
78
|
+
add_reference(:lesli_babel_strings, :bucket, foreign_key: { to_table: :lesli_babel_buckets })
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
=begin
|
|
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.dev
|
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
28
|
+
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
|
+
// ·
|
|
31
|
+
=end
|
|
32
|
+
|
|
33
|
+
module LesliBabel
|
|
34
|
+
class Engine < ::Rails::Engine
|
|
35
|
+
isolate_namespace LesliBabel
|
|
36
|
+
|
|
37
|
+
initializer :lesli_babel do |app|
|
|
38
|
+
|
|
39
|
+
# register assets manifest
|
|
40
|
+
config.assets.precompile += %w[lesli_babel_manifest.js]
|
|
41
|
+
|
|
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]
|
|
45
|
+
|
|
46
|
+
# register engine migrations path
|
|
47
|
+
unless app.root.to_s.match root.to_s
|
|
48
|
+
config.paths["db/migrate"].expanded.each do |expanded_path|
|
|
49
|
+
app.config.paths["db/migrate"] << expanded_path
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
data/lib/lesli_babel.rb
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
=begin
|
|
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
|
|
32
|
+
|
|
33
|
+
require "json"
|
|
34
|
+
|
|
35
|
+
namespace :lesli_babel do
|
|
36
|
+
|
|
37
|
+
desc "Delete translations files"
|
|
38
|
+
task clean: [:environment] do
|
|
39
|
+
|
|
40
|
+
result = CloudBabel::TranslationsService.clean
|
|
41
|
+
result.payload.each do |file_path|
|
|
42
|
+
p "delete translations for: #{file_path.to_s}"
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
desc "Create standard structure for translations according to the objects in the app"
|
|
48
|
+
task scan: [:environment] do
|
|
49
|
+
|
|
50
|
+
engines = Lesli::SystemController.index(matrix: false)
|
|
51
|
+
|
|
52
|
+
engines.each do |t|
|
|
53
|
+
|
|
54
|
+
platform = "lesli_engine"
|
|
55
|
+
platform = "lesli_core" if t[:engine] == "lesli"
|
|
56
|
+
|
|
57
|
+
# 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 })
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
L2.msg "CloudBabel: Module/Controllers scanned and registered"
|
|
65
|
+
|
|
66
|
+
end
|
|
67
|
+
|
|
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
|
+
|
|
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
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
return controller_list
|
|
120
|
+
end
|
|
121
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2020, 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 application from "Lesli/application"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
// ·
|
|
24
|
+
import appDashboardShow from "LesliBabel/apps/dashboards/show.vue"
|
|
25
|
+
import appRelevantsIndex from "LesliBabel/apps/relevants/index.vue"
|
|
26
|
+
import appTranslationsIndex from "LesliBabel/apps/translations/index.vue"
|
|
27
|
+
import appModulesShow from "LesliBabel/apps/modules/show.vue"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// ·
|
|
31
|
+
application("LesliBabel", [{
|
|
32
|
+
path: "/",
|
|
33
|
+
component: appDashboardShow
|
|
34
|
+
}, {
|
|
35
|
+
path: "/dashboard",
|
|
36
|
+
component: appDashboardShow
|
|
37
|
+
}, {
|
|
38
|
+
path: "/translations",
|
|
39
|
+
component: appTranslationsIndex
|
|
40
|
+
}, {
|
|
41
|
+
path: "/relevants",
|
|
42
|
+
component: appRelevantsIndex
|
|
43
|
+
}, {
|
|
44
|
+
path: "/modules/:id",
|
|
45
|
+
component: appModulesShow
|
|
46
|
+
}])
|
|
@@ -0,0 +1,85 @@
|
|
|
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/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/stores/statistics"
|
|
37
|
+
import { useStrings } from "LesliBabel/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 mt-2">
|
|
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 }).s" >
|
|
75
|
+
<span :class="['mb-2', 'is-size-2','flag-icon', flag(locale.code)]"></span>
|
|
76
|
+
<p class="is-size-5">
|
|
77
|
+
{{ locale.name }}: {{ locale.total }}
|
|
78
|
+
</p>
|
|
79
|
+
<small>
|
|
80
|
+
missing: {{ storeStatistics.totalStrings - locale.total }} translations
|
|
81
|
+
</small>
|
|
82
|
+
</router-link>
|
|
83
|
+
</div>
|
|
84
|
+
</lesli-application-container>
|
|
85
|
+
</template>
|
|
@@ -0,0 +1,97 @@
|
|
|
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, onUnmounted } from "vue"
|
|
22
|
+
import { useRouter, useRoute } from 'vue-router'
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
// · import components
|
|
26
|
+
import formStringNew from "LesliBabel/components/form-string-new.vue"
|
|
27
|
+
import formLabelEditor from "LesliBabel/components/form-label-editor.vue"
|
|
28
|
+
import componentActions from "LesliBabel/components/actions.vue"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// · import lesli stores
|
|
32
|
+
import { useModule } from "LesliBabel/stores/module"
|
|
33
|
+
import { useStrings } from "LesliBabel/stores/strings"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
// · implement stores
|
|
37
|
+
const storeModule = useModule()
|
|
38
|
+
const storeStrings = useStrings()
|
|
39
|
+
const router = useRouter()
|
|
40
|
+
const route = useRoute()
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
// ·
|
|
44
|
+
onMounted(() => {
|
|
45
|
+
storeModule.fetchModule(route.params.id)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
// ·
|
|
50
|
+
function getModule() {
|
|
51
|
+
return route.params?.id
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
// ·
|
|
56
|
+
function search(string) {
|
|
57
|
+
router.push({ query: { search: string }})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
// ·
|
|
62
|
+
watch(() => route.params.id, () => {
|
|
63
|
+
storeModule.fetchModule(route.params.id)
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
</script>
|
|
67
|
+
<template>
|
|
68
|
+
<section class="application-component">
|
|
69
|
+
<lesli-header :title="storeModule.name">
|
|
70
|
+
<component-actions></component-actions>
|
|
71
|
+
<lesli-button solid icon="add" @click="storeStrings.showPanel = true">
|
|
72
|
+
add new string
|
|
73
|
+
</lesli-button>
|
|
74
|
+
</lesli-header>
|
|
75
|
+
|
|
76
|
+
<lesli-toolbar @search="search">
|
|
77
|
+
</lesli-toolbar>
|
|
78
|
+
|
|
79
|
+
<formLabelEditor :module="getModule()">
|
|
80
|
+
</formLabelEditor>
|
|
81
|
+
|
|
82
|
+
<lesli-panel v-model:open="storeStrings.showPanel">
|
|
83
|
+
<template #header>
|
|
84
|
+
<span class="icon">
|
|
85
|
+
<span class="material-icons">
|
|
86
|
+
translate
|
|
87
|
+
</span>
|
|
88
|
+
</span>
|
|
89
|
+
Add new string to translate
|
|
90
|
+
</template>
|
|
91
|
+
<template #default>
|
|
92
|
+
<formStringNew v-if="storeModule.id" :module-id="storeModule.id">
|
|
93
|
+
</formStringNew>
|
|
94
|
+
</template>
|
|
95
|
+
</lesli-panel>
|
|
96
|
+
</section>
|
|
97
|
+
</template>
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
// · initialize/inject plugins
|
|
26
|
+
const router = useRouter()
|
|
27
|
+
const route = useRoute()
|
|
28
|
+
const msg = inject("msg")
|
|
29
|
+
const url = inject("url")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
// · import components
|
|
33
|
+
import componentLabelEditor from "LesliBabel/components/form-label-editor.vue"
|
|
34
|
+
import componentActions from "LesliBabel/components/actions.vue"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
</script>
|
|
38
|
+
<template>
|
|
39
|
+
<section class="application-component">
|
|
40
|
+
<lesli-header title="Relevant translations">
|
|
41
|
+
<component-actions></component-actions>
|
|
42
|
+
</lesli-header>
|
|
43
|
+
|
|
44
|
+
<component-label-editor module="relevants">
|
|
45
|
+
</component-label-editor>
|
|
46
|
+
</section>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
// · initialize/inject plugins
|
|
26
|
+
const router = useRouter()
|
|
27
|
+
const route = useRoute()
|
|
28
|
+
const msg = inject("msg")
|
|
29
|
+
const url = inject("url")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
// · import components
|
|
33
|
+
import componentLabelEditor from "LesliBabel/components/form-label-editor.vue"
|
|
34
|
+
import componentActions from "LesliBabel/components/actions.vue"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
// · import lesli stores
|
|
38
|
+
import { useStrings } from "LesliBabel/stores/strings"
|
|
39
|
+
import { useTranslations } from "LesliBabel/stores/translations"
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
// · implement stores
|
|
43
|
+
const storeStrings = useStrings()
|
|
44
|
+
const storeTranslations = useTranslations()
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
// ·
|
|
48
|
+
function search(string) {
|
|
49
|
+
router.push({ path: "translations", query: { search: string }})
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
<template>
|
|
53
|
+
<lesli-application-container>
|
|
54
|
+
<lesli-header title="Translations">
|
|
55
|
+
<component-actions></component-actions>
|
|
56
|
+
</lesli-header>
|
|
57
|
+
|
|
58
|
+
<lesli-toolbar :initial-value="storeStrings.search" @search="search">
|
|
59
|
+
</lesli-toolbar>
|
|
60
|
+
|
|
61
|
+
<component-label-editor>
|
|
62
|
+
</component-label-editor>
|
|
63
|
+
</lesli-application-container>
|
|
64
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
|
|
3
|
+
// · import lesli stores
|
|
4
|
+
import { useTranslations } from "LesliBabel/stores/translations"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// · implement stores
|
|
8
|
+
const storeTranslations = useTranslations()
|
|
9
|
+
|
|
10
|
+
</script>
|
|
11
|
+
<template>
|
|
12
|
+
<lesli-button icon="download" @click="storeTranslations.postRenovate()">
|
|
13
|
+
update
|
|
14
|
+
</lesli-button>
|
|
15
|
+
<lesli-button icon="rocket_launch" @click="storeTranslations.postDeploy()">
|
|
16
|
+
deploy
|
|
17
|
+
</lesli-button>
|
|
18
|
+
<lesli-button icon="sync" @click="storeTranslations.postSync()">
|
|
19
|
+
sync
|
|
20
|
+
</lesli-button>
|
|
21
|
+
<!--
|
|
22
|
+
<lesli-button icon="code">
|
|
23
|
+
javascript
|
|
24
|
+
</lesli-button>
|
|
25
|
+
<lesli-button icon="code">
|
|
26
|
+
flutter
|
|
27
|
+
</lesli-button>
|
|
28
|
+
-->
|
|
29
|
+
</template>
|