From 9291f7fb3c57d11045cd093f12c9377b02e8f0ec Mon Sep 17 00:00:00 2001 From: Adam Ploshay Date: Wed, 2 Oct 2024 14:21:04 -0400 Subject: [PATCH 1/2] prepare override of #available_translations --- app/helpers/hyrax_helper.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/helpers/hyrax_helper.rb b/app/helpers/hyrax_helper.rb index 4783956..0b5f0ab 100644 --- a/app/helpers/hyrax_helper.rb +++ b/app/helpers/hyrax_helper.rb @@ -9,4 +9,19 @@ def render_markdown(field) text = field[:value].join("\n\n") DataCatalog::MarkdownService.call(text).html_safe end + + # import hyrax method + # Which translations are available for the user to select + # @return [Hash{String => String}] locale abbreviations as keys and flags as values + def available_translations + { + 'de' => 'Deutsch', + 'en' => 'English', + 'es' => 'Español', + 'fr' => 'Français', + 'it' => 'Italiano', + 'pt-BR' => 'Português do Brasil', + 'zh' => '中文' + } + end end From 68a7c7e7d94170dcfb2b47b23dbbf66037f0e039 Mon Sep 17 00:00:00 2001 From: Adam Ploshay Date: Wed, 2 Oct 2024 14:20:25 -0400 Subject: [PATCH 2/2] override #available_translations to english, only --- app/helpers/hyrax_helper.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/helpers/hyrax_helper.rb b/app/helpers/hyrax_helper.rb index 0b5f0ab..b6b30e2 100644 --- a/app/helpers/hyrax_helper.rb +++ b/app/helpers/hyrax_helper.rb @@ -10,18 +10,12 @@ def render_markdown(field) DataCatalog::MarkdownService.call(text).html_safe end - # import hyrax method + # override hyrax method # Which translations are available for the user to select # @return [Hash{String => String}] locale abbreviations as keys and flags as values def available_translations { - 'de' => 'Deutsch', - 'en' => 'English', - 'es' => 'Español', - 'fr' => 'Français', - 'it' => 'Italiano', - 'pt-BR' => 'Português do Brasil', - 'zh' => '中文' + 'en' => 'English' } end end