decidim-term_customizer 0.17.0 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -8
- data/app/assets/config/translation_sets_admin_manifest.js +1 -0
- data/app/controllers/decidim/term_customizer/admin/translation_sets_controller.rb +1 -12
- data/app/controllers/decidim/term_customizer/admin/translations_controller.rb +12 -1
- data/app/forms/decidim/term_customizer/admin/translations_destroy_form.rb +3 -3
- data/app/views/decidim/term_customizer/admin/add_translations/index.html.erb +1 -1
- data/app/views/decidim/term_customizer/admin/translation_sets/_form.html.erb +2 -2
- data/app/views/decidim/term_customizer/admin/translation_sets/index.html.erb +4 -0
- data/app/views/decidim/term_customizer/admin/translations/_export_dropdown.html.erb +1 -1
- data/app/views/decidim/term_customizer/admin/translations/_form.html.erb +1 -1
- data/app/views/decidim/term_customizer/admin/translations/index.html.erb +2 -2
- data/app/views/decidim/term_customizer/admin/translations/new_import.html.erb +1 -1
- data/app/views/decidim/term_customizer/admin/translations_destroys/new.html.erb +1 -1
- data/config/locales/ca.yml +2 -1
- data/config/locales/en.yml +2 -1
- data/config/locales/es.yml +2 -1
- data/config/locales/fi.yml +2 -1
- data/config/locales/fr.yml +3 -2
- data/config/locales/sv.yml +2 -1
- data/lib/decidim/term_customizer/admin_engine.rb +1 -4
- data/lib/decidim/term_customizer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 966d2f30474a9b53bbdc7ae485ea6a726a550c4cdc111329257f259ba3eca5ee
|
4
|
+
data.tar.gz: 0fec267d0fbe868fac3840aefa9843456974662eebf5701a0689de0c509c3203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa686d4635bf8f37c1eab0a6e4d3e794be3d5ab9623de5763e29d6f40036e99563722a206e2f3532bbd2e1ff3ce30efd824cd9f41c04c3e029cb8566f9b141ec
|
7
|
+
data.tar.gz: 5d760d7ea2ba5f43a8c20e5f4836ecc9c9443f1c3a68d0b667748233e1a71bcde0cf5b89341ecf742edc44c6fe76ba3f2d2791fe62e5d31133e813652110777a
|
data/Rakefile
CHANGED
@@ -38,11 +38,3 @@ task :development_app do
|
|
38
38
|
install_module("development_app")
|
39
39
|
seed_db("development_app")
|
40
40
|
end
|
41
|
-
|
42
|
-
# Run all tests, include all
|
43
|
-
RSpec::Core::RakeTask.new(:spec) do |t|
|
44
|
-
t.verbose = false
|
45
|
-
end
|
46
|
-
|
47
|
-
# Run both by default
|
48
|
-
task default: [:spec]
|
@@ -60,7 +60,7 @@ module Decidim
|
|
60
60
|
end
|
61
61
|
|
62
62
|
on(:invalid) do
|
63
|
-
flash.now[:alert] = I18n.t("translation_sets.update.
|
63
|
+
flash.now[:alert] = I18n.t("translation_sets.update.error", scope: "decidim.term_customizer.admin")
|
64
64
|
render action: "edit"
|
65
65
|
end
|
66
66
|
end
|
@@ -75,17 +75,6 @@ module Decidim
|
|
75
75
|
redirect_to translation_sets_path
|
76
76
|
end
|
77
77
|
|
78
|
-
def export
|
79
|
-
enforce_permission_to :export, :translation_set, translation_set: set
|
80
|
-
name = "set-translations"
|
81
|
-
|
82
|
-
ExportJob.perform_later(current_user, set, name, params[:format] || "json")
|
83
|
-
|
84
|
-
flash[:notice] = I18n.t("exports.notice", scope: "decidim.admin")
|
85
|
-
|
86
|
-
redirect_to translation_set_translations_path(set)
|
87
|
-
end
|
88
|
-
|
89
78
|
private
|
90
79
|
|
91
80
|
def sets
|
@@ -59,7 +59,7 @@ module Decidim
|
|
59
59
|
end
|
60
60
|
|
61
61
|
on(:invalid) do
|
62
|
-
flash.now[:alert] = I18n.t("translations.update.
|
62
|
+
flash.now[:alert] = I18n.t("translations.update.error", scope: "decidim.term_customizer.admin")
|
63
63
|
render action: "edit"
|
64
64
|
end
|
65
65
|
end
|
@@ -79,6 +79,17 @@ module Decidim
|
|
79
79
|
redirect_to translation_set_translations_path(set)
|
80
80
|
end
|
81
81
|
|
82
|
+
def export
|
83
|
+
enforce_permission_to :export, :translation_set, translation_set: set
|
84
|
+
name = "set-translations"
|
85
|
+
|
86
|
+
ExportJob.perform_later(current_user, set, name, params[:format] || "json")
|
87
|
+
|
88
|
+
flash[:notice] = I18n.t("exports.notice", scope: "decidim.admin")
|
89
|
+
|
90
|
+
redirect_to translation_set_translations_path(set)
|
91
|
+
end
|
92
|
+
|
82
93
|
def new_import
|
83
94
|
enforce_permission_to :import, :translation_set, translation_set: set
|
84
95
|
|
@@ -20,7 +20,7 @@ module Decidim
|
|
20
20
|
|
21
21
|
@translations ||= translation_set.translations.where(
|
22
22
|
key: translation_keys
|
23
|
-
)
|
23
|
+
).order(:id)
|
24
24
|
end
|
25
25
|
|
26
26
|
# Only the translations passed with the IDs (current locale).
|
@@ -28,8 +28,8 @@ module Decidim
|
|
28
28
|
return [] unless translation_set
|
29
29
|
|
30
30
|
@translations_current ||= translation_set.translations.where(
|
31
|
-
id: translation_ids
|
32
|
-
).
|
31
|
+
id: translation_ids.uniq
|
32
|
+
).order(:id)
|
33
33
|
end
|
34
34
|
|
35
35
|
private
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="card-divider">
|
3
3
|
<h2 class="card-title flex--sbc">
|
4
4
|
<div>
|
5
|
-
<%= link_to t("decidim.term_customizer.menu.term_customizer"),
|
5
|
+
<%= link_to t("decidim.term_customizer.menu.term_customizer"), translation_sets_path %>
|
6
6
|
>
|
7
7
|
<%= link_to translated_attribute(set.name), translation_set_translations_path(set) %>
|
8
8
|
>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="card-divider">
|
3
3
|
<h2 class="card-title flex--sbc">
|
4
4
|
<div>
|
5
|
-
<%= link_to t("decidim.term_customizer.menu.term_customizer"),
|
5
|
+
<%= link_to t("decidim.term_customizer.menu.term_customizer"), translation_sets_path %>
|
6
6
|
>
|
7
7
|
<%= t "translation_sets.form.title", scope: "decidim.term_customizer.admin" %>
|
8
8
|
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
<div class="flex--cc flex-gap--1">
|
16
16
|
<div id="js-other-actions-wrapper">
|
17
|
-
<%= link_to t("actions.back", scope: "decidim.term_customizer.admin"),
|
17
|
+
<%= link_to t("actions.back", scope: "decidim.term_customizer.admin"), translation_sets_path, class: "button hollow tiny button--simple" %>
|
18
18
|
</div>
|
19
19
|
</div>
|
20
20
|
</h2>
|
@@ -38,6 +38,10 @@
|
|
38
38
|
<% end %>
|
39
39
|
</td>
|
40
40
|
<td class="table-list__actions">
|
41
|
+
<% if allowed_to? :read, :translation %>
|
42
|
+
<%= icon_link_to "eye", translation_set_translations_path(set), t("actions.view", scope: "decidim.term_customizer.admin"), class: "action-icon--show" %>
|
43
|
+
<% end %>
|
44
|
+
|
41
45
|
<% if allowed_to? :update, :translation_set, translation_set: set %>
|
42
46
|
<%= icon_link_to "pencil", edit_translation_set_path(set), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %>
|
43
47
|
<% end %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="dropdown-pane" id="export-dropdown" data-dropdown data-position=bottom data-alignment=right data-auto-focus="true" data-close-on-click="true">
|
3
3
|
<ul class="vertical menu add-components">
|
4
4
|
<% %w{CSV JSON Excel}.each do |format| %>
|
5
|
-
<li class="exports--format--<%= format.downcase %> exports--translations"><%= link_to t("decidim.admin.exports.export_as", name: t("decidim.term_customizer.admin.titles.translations"), export_format: format.upcase),
|
5
|
+
<li class="exports--format--<%= format.downcase %> exports--translations"><%= link_to t("decidim.admin.exports.export_as", name: t("decidim.term_customizer.admin.titles.translations"), export_format: format.upcase), export_translation_set_translations_path(set, format: format), method: :post %></li>
|
6
6
|
<% end %>
|
7
7
|
</ul>
|
8
8
|
</div>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="card-divider">
|
3
3
|
<h2 class="card-title flex--sbc">
|
4
4
|
<div>
|
5
|
-
<%= link_to t("decidim.term_customizer.menu.term_customizer"),
|
5
|
+
<%= link_to t("decidim.term_customizer.menu.term_customizer"), translation_sets_path %>
|
6
6
|
>
|
7
7
|
<%= link_to translated_attribute(set.name), translation_set_translations_path(set) %>
|
8
8
|
>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="card-divider">
|
3
3
|
<h2 class="card-title flex--sbc">
|
4
4
|
<div>
|
5
|
-
<%= link_to t("decidim.term_customizer.menu.term_customizer"),
|
5
|
+
<%= link_to t("decidim.term_customizer.menu.term_customizer"), translation_sets_path %>
|
6
6
|
>
|
7
7
|
<%= translated_attribute(set.name) %>
|
8
8
|
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<% if allowed_to? :import, :translation_set, translation_set: set %>
|
21
21
|
<%= link_to t("actions.import", scope: "decidim.term_customizer.admin"), import_translation_set_translations_path(set), class: "button tiny button--simple" %>
|
22
22
|
<% end %>
|
23
|
-
<% if allowed_to?
|
23
|
+
<% if set.translations.count > 0 && allowed_to?(:export, :translation_set, translation_set: set) %>
|
24
24
|
<%= render partial: "export_dropdown" %>
|
25
25
|
<% end %>
|
26
26
|
</div>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<div class="card-divider">
|
4
4
|
<h2 class="card-title flex--sbc">
|
5
5
|
<div>
|
6
|
-
<%= link_to t("decidim.term_customizer.menu.term_customizer"),
|
6
|
+
<%= link_to t("decidim.term_customizer.menu.term_customizer"), translation_sets_path %>
|
7
7
|
>
|
8
8
|
<%= link_to translated_attribute(set.name), translation_set_translations_path(set) %>
|
9
9
|
>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<div class="card-divider">
|
4
4
|
<h2 class="card-title flex--sbc">
|
5
5
|
<div>
|
6
|
-
<%= link_to t("decidim.term_customizer.menu.term_customizer"),
|
6
|
+
<%= link_to t("decidim.term_customizer.menu.term_customizer"), translation_sets_path %>
|
7
7
|
>
|
8
8
|
<%= link_to translated_attribute(set.name), translation_set_translations_path(set) %>
|
9
9
|
>
|
data/config/locales/ca.yml
CHANGED
@@ -30,6 +30,7 @@ ca:
|
|
30
30
|
import: Import
|
31
31
|
new_translation: Nova traducció
|
32
32
|
new_translation_set: Nou set/joc de traducció
|
33
|
+
view: View
|
33
34
|
add_translations:
|
34
35
|
index:
|
35
36
|
add: Afegir
|
@@ -70,7 +71,7 @@ ca:
|
|
70
71
|
constraint_help_title: What are constraints?
|
71
72
|
help_html: <p>A translation set is a "container" that holds the translations for a specific context you want to customize.</p> <p>Translation sets help you to organize your customizations and apply them to different contexts. This allows you to customize the same translation differently in different contexts.</p> <p>For example, if you want to customize a button with the term "Add" differently for different participatory processes, you can create separate translation sets for both processes and apply the set to those processes using the constraints.</p>
|
72
73
|
help_title: What is a translation set?
|
73
|
-
title:
|
74
|
+
title: Set/Joc de traducció
|
74
75
|
index:
|
75
76
|
no_records_html: <p>No translation sets available.</p> <p>Start by adding a translation set from the "<a href="%{new_set_link}">%{button_name}</a>" button.</p>
|
76
77
|
new:
|
data/config/locales/en.yml
CHANGED
@@ -31,6 +31,7 @@ en:
|
|
31
31
|
import: Import
|
32
32
|
new_translation: New translation
|
33
33
|
new_translation_set: New translation set
|
34
|
+
view: View
|
34
35
|
add_translations:
|
35
36
|
index:
|
36
37
|
add: Add
|
@@ -94,7 +95,7 @@ en:
|
|
94
95
|
processes, you can create separate translation sets for both processes
|
95
96
|
and apply the set to those processes using the constraints.</p>
|
96
97
|
help_title: What is a translation set?
|
97
|
-
title: Translation set
|
98
|
+
title: Translation set
|
98
99
|
index:
|
99
100
|
no_records_html: <p>No translation sets available.</p> <p>Start by adding
|
100
101
|
a translation set from the "<a href="%{new_set_link}">%{button_name}</a>"
|
data/config/locales/es.yml
CHANGED
@@ -30,6 +30,7 @@ es:
|
|
30
30
|
import: Import
|
31
31
|
new_translation: Nueva traducción
|
32
32
|
new_translation_set: Nuevo grupo de traducciones
|
33
|
+
view: View
|
33
34
|
add_translations:
|
34
35
|
index:
|
35
36
|
add: Añadir
|
@@ -70,7 +71,7 @@ es:
|
|
70
71
|
constraint_help_title: What are constraints?
|
71
72
|
help_html: <p>A translation set is a "container" that holds the translations for a specific context you want to customize.</p> <p>Translation sets help you to organize your customizations and apply them to different contexts. This allows you to customize the same translation differently in different contexts.</p> <p>For example, if you want to customize a button with the term "Add" differently for different participatory processes, you can create separate translation sets for both processes and apply the set to those processes using the constraints.</p>
|
72
73
|
help_title: What is a translation set?
|
73
|
-
title:
|
74
|
+
title: Grupo de traducciones
|
74
75
|
index:
|
75
76
|
no_records_html: <p>No translation sets available.</p> <p>Start by adding a translation set from the "<a href="%{new_set_link}">%{button_name}</a>" button.</p>
|
76
77
|
new:
|
data/config/locales/fi.yml
CHANGED
@@ -30,6 +30,7 @@ fi:
|
|
30
30
|
import: Tuo
|
31
31
|
new_translation: Uusi käännös
|
32
32
|
new_translation_set: Uusi käännöspaketti
|
33
|
+
view: Näytä
|
33
34
|
add_translations:
|
34
35
|
index:
|
35
36
|
add: Lisää
|
@@ -70,7 +71,7 @@ fi:
|
|
70
71
|
constraint_help_title: Mitä ovat rajaussäännöt?
|
71
72
|
help_html: <p>Käännöspaketti, on "paketti", joka sisältää käännöksiä tietylle kontekstille, jonka termejä haluat muuttaa.</p><p>Käännöspaketit auttavat sinua pitämään kustomointisi järjestyksessä ja rajaamaan niitä tiettyihin konteksteihin. Tämä mahdollistaa sen, että voit esimerkiksi muuttaa saman termin eri tavalla sivuston eri paikoissa.</p><p>Mikäli haluat esimerkiski muuttaa "Lisää" -napin tekstin erilaiseksi eri prosesseille, voit luoda kaksi erillistä käännöspakettia molempia prosesseja varten. Molemmat paketit rajataan kyseisiin prosesseihin rajaussääntöjen avulla.</p>
|
72
73
|
help_title: Mikä on käännöspaketti?
|
73
|
-
title: Käännöspaketti
|
74
|
+
title: Käännöspaketti
|
74
75
|
index:
|
75
76
|
no_records_html: <p>Ei käännöspaketteja.</p><p>Aloita lisäämällä käännöspaketti "<a href="%{new_set_link}">%{button_name}</a>" -napin avulla.</p>
|
76
77
|
new:
|
data/config/locales/fr.yml
CHANGED
@@ -30,6 +30,7 @@ fr:
|
|
30
30
|
import: Import
|
31
31
|
new_translation: Nouvelle traduction
|
32
32
|
new_translation_set: Nouveau jeu de traduction
|
33
|
+
view: View
|
33
34
|
add_translations:
|
34
35
|
index:
|
35
36
|
add: Ajouter
|
@@ -63,14 +64,14 @@ fr:
|
|
63
64
|
success: Le jeu de traduction a été supprimé.
|
64
65
|
edit:
|
65
66
|
save: Sauvegarder
|
66
|
-
title: Jeu de
|
67
|
+
title: Jeu de traductions
|
67
68
|
form:
|
68
69
|
add_constraint: Ajouter contrainte
|
69
70
|
constraint_help_html: <p>Constraints are specific rules that allow you to apply the customizations in a set to a specific context.</p> <p>In case you do not define any constraint rules, the customizations in this set will apply to the whole application. On the other hand, if you want the customizations in this set to apply only to a specific process, select "Participatory processes" as the participatory space type and the target process as the participatory space. Furthermore, you can also apply the customizations to a specific component by defining the component for the constraint.</p> <p>If you define multiple constraints, the customizations will apply in all of those.</p>
|
70
71
|
constraint_help_title: What are constraints?
|
71
72
|
help_html: <p>A translation set is a "container" that holds the translations for a specific context you want to customize.</p> <p>Translation sets help you to organize your customizations and apply them to different contexts. This allows you to customize the same translation differently in different contexts.</p> <p>For example, if you want to customize a button with the term "Add" differently for different participatory processes, you can create separate translation sets for both processes and apply the set to those processes using the constraints.</p>
|
72
73
|
help_title: What is a translation set?
|
73
|
-
title:
|
74
|
+
title: Jeu de traductions
|
74
75
|
index:
|
75
76
|
no_records_html: <p>No translation sets available.</p> <p>Start by adding a translation set from the "<a href="%{new_set_link}">%{button_name}</a>" button.</p>
|
76
77
|
new:
|
data/config/locales/sv.yml
CHANGED
@@ -30,6 +30,7 @@ sv:
|
|
30
30
|
import: Import
|
31
31
|
new_translation: New translation
|
32
32
|
new_translation_set: New translation set
|
33
|
+
view: View
|
33
34
|
add_translations:
|
34
35
|
index:
|
35
36
|
add: Add
|
@@ -70,7 +71,7 @@ sv:
|
|
70
71
|
constraint_help_title: What are constraints?
|
71
72
|
help_html: <p>A translation set is a "container" that holds the translations for a specific context you want to customize.</p> <p>Translation sets help you to organize your customizations and apply them to different contexts. This allows you to customize the same translation differently in different contexts.</p> <p>For example, if you want to customize a button with the term "Add" differently for different participatory processes, you can create separate translation sets for both processes and apply the set to those processes using the constraints.</p>
|
72
73
|
help_title: What is a translation set?
|
73
|
-
title: Translation set
|
74
|
+
title: Translation set
|
74
75
|
index:
|
75
76
|
no_records_html: <p>No translation sets available.</p> <p>Start by adding a translation set from the "<a href="%{new_set_link}">%{button_name}</a>" button.</p>
|
76
77
|
new:
|
@@ -10,12 +10,9 @@ module Decidim
|
|
10
10
|
|
11
11
|
routes do
|
12
12
|
resources :translation_sets, path: :sets, except: [:show] do
|
13
|
-
member do
|
14
|
-
post :export
|
15
|
-
end
|
16
|
-
|
17
13
|
resources :translations, except: [:show] do
|
18
14
|
collection do
|
15
|
+
post :export
|
19
16
|
get :import, action: :new_import
|
20
17
|
post :import
|
21
18
|
resource :translations_destroy, only: [:new, :destroy]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-term_customizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antti Hukkanen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: decidim-admin
|