From f67a004003ae80e2af3cdbfb41fe36609a4fe377 Mon Sep 17 00:00:00 2001 From: Liane Hampe Date: Sat, 16 Jan 2021 13:52:42 +0100 Subject: [PATCH 1/5] Add German translations --- changelog.md | 4 ++++ config/locales/de.yml | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 config/locales/de.yml diff --git a/changelog.md b/changelog.md index 74244fb..33b8301 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Redmine message customize plugin changelog +## v0.1.1 + +* Add german translations + ## v0.1.0 * [Fix "Infinite loop occurs in the process of calling I18n.available_locales"(Redmine 4.1 compatible)](https://github.com/ishikawa999/redmine_message_customize/issues/12) diff --git a/config/locales/de.yml b/config/locales/de.yml new file mode 100644 index 0000000..f7b649d --- /dev/null +++ b/config/locales/de.yml @@ -0,0 +1,24 @@ +de: + label_custom_messages: Benutzerdefinierte Bezeichnungen + text_help_for_input_format: Bitte geben Sie die Keywörter der Bezeichnungen, die Sie anpanssen möchten, im YAML-Format ein. + text_placeholder_template_case: 'Beispiel: Umbenennen von "Home" zu "TOP"' + text_placeholder_yaml_template: | + en: + label_home: 'TOP' + text_placeholder_choose_key: Bitte wählen Sie die Bezeichnung aus, die Sie ändern möchten. + text_description_of_search_box: Sie können Suchbegriffe eingeben, um die Ergebnisse einzugrenzen. + text_for_your_reference: Beispiele für die Schreibweise können Sie hier:" %{value}" einsehen. + text_disabled_customize: Alle benutzerdefinierten Bezeichnungen sind deaktiviert. + + error_unused_keys: Sie versuchen ein Keywort zu verwenden, das Redmine nicht unterstützt. + error_unavailable_languages: Sie versuchen eine Sprache zu verwenden, die Redmine nicht unterstützt. + error_unusable_type_of_keys: Dieses Plugin kann nur Strings anpassen. + error_invalid_yaml_format: Das YAML-Format ist ungültig. + error_value_too_long: Ihre Anpassungen können nicht gespeichert werden. Versuchen Sie die Anzahl der Änderungen zu reduzieren. + notice_enabled_customize: Benutzerdefinierte Bezeichnungen erfolgreich aktiviert. + notice_disabled_customize: Benutzerdefinierte Bezeichnungen erfolgreich deaktiviert. + label_normal_tab: Normaler Modus + label_yaml_tab: YAML Modus + label_enable_customize: Aktiviere eigene Anpassungen + label_disable_customize: Deaktiviere eigene Anpassungen + label_default_messages: Standardbezeichnugen ansehen \ No newline at end of file From ad264edda4bac2c818aced08c69028a191029630 Mon Sep 17 00:00:00 2001 From: Liane Hampe Date: Sat, 16 Jan 2021 14:05:43 +0100 Subject: [PATCH 2/5] Modify load order of locales The load order as controlled by an additional code snippet during Redmine initialization is modified to be conditional. That is, the code won't get executed when the redmine_message_customize plugin is not installed anymore. This won't break the restart when the plugin is (temporarily) uninstalled but the additional file in Redmine config/initializers is not removed. --- 35_change_load_order_locales.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/35_change_load_order_locales.rb b/35_change_load_order_locales.rb index f244a70..77a3f3f 100755 --- a/35_change_load_order_locales.rb +++ b/35_change_load_order_locales.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true -p = Redmine::Plugin.find(:redmine_message_customize) -custom_locales = Dir.glob(File.join(p.directory, 'config', 'locales', 'custom_messages', '*.rb')) -Rails.application.config.i18n.load_path = (Rails.application.config.i18n.load_path - custom_locales + custom_locales) +if Redmine::Plugin.installed? :redmine_message_customize + p = Redmine::Plugin.find(:redmine_message_customize) + custom_locales = Dir.glob(File.join(p.directory, 'config', 'locales', 'custom_messages', '*.rb')) + Rails.application.config.i18n.load_path = (Rails.application.config.i18n.load_path - custom_locales + custom_locales) +end \ No newline at end of file From 3091617c15bf6a5da6176f13b5eec624cb51a2e7 Mon Sep 17 00:00:00 2001 From: Liane Hampe Date: Sat, 16 Jan 2021 14:16:54 +0100 Subject: [PATCH 3/5] Update Changelog --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 33b8301..787f3f6 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ ## v0.1.1 * Add german translations +* Change reordered loading of locales to be conditional ## v0.1.0 From 620a0604bdc2e8aa4a8f20af8a7340048353cf83 Mon Sep 17 00:00:00 2001 From: Liane Hampe Date: Sat, 16 Jan 2021 14:36:55 +0100 Subject: [PATCH 4/5] Add .gitignore file --- .gitignore | 1 + 35_change_load_order_locales.rb | 2 +- config/locales/de.yml | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1795c8d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.history \ No newline at end of file diff --git a/35_change_load_order_locales.rb b/35_change_load_order_locales.rb index 77a3f3f..865f4fe 100755 --- a/35_change_load_order_locales.rb +++ b/35_change_load_order_locales.rb @@ -4,4 +4,4 @@ p = Redmine::Plugin.find(:redmine_message_customize) custom_locales = Dir.glob(File.join(p.directory, 'config', 'locales', 'custom_messages', '*.rb')) Rails.application.config.i18n.load_path = (Rails.application.config.i18n.load_path - custom_locales + custom_locales) -end \ No newline at end of file +end diff --git a/config/locales/de.yml b/config/locales/de.yml index f7b649d..45d64d6 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -21,4 +21,5 @@ de: label_yaml_tab: YAML Modus label_enable_customize: Aktiviere eigene Anpassungen label_disable_customize: Deaktiviere eigene Anpassungen - label_default_messages: Standardbezeichnugen ansehen \ No newline at end of file + label_default_messages: Standardbezeichnugen ansehen + \ No newline at end of file From 42a46fa60e8fdad12b3201f2003040d13f873497 Mon Sep 17 00:00:00 2001 From: Liane Hampe Date: Sat, 16 Jan 2021 22:22:00 +0100 Subject: [PATCH 5/5] Change menu item in admin menu The menu item of CustomMessageSettingsController#edit page is now highlighted as soon as the user selects the respective item. This behavior is now consistent with all other menu items of the admin menu in the sidebar of the admin page. --- app/controllers/custom_message_settings_controller.rb | 1 + changelog.md | 1 + 2 files changed, 2 insertions(+) diff --git a/app/controllers/custom_message_settings_controller.rb b/app/controllers/custom_message_settings_controller.rb index 1f35ebc..51900c2 100644 --- a/app/controllers/custom_message_settings_controller.rb +++ b/app/controllers/custom_message_settings_controller.rb @@ -1,5 +1,6 @@ class CustomMessageSettingsController < ApplicationController layout 'admin' + menu_item :custom_messages before_action :require_admin, :set_custom_message_setting, :set_lang require_sudo_mode :edit, :update, :toggle_enabled, :default_messages diff --git a/changelog.md b/changelog.md index 787f3f6..a1baa85 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ * Add german translations * Change reordered loading of locales to be conditional +* Change admin menu item of custom message settings to be highlighted when selected ## v0.1.0