From ef34816f368e328f761751b50b03e316fcb17bad Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Fri, 11 Jan 2019 14:28:07 +0100 Subject: [PATCH] Bug 22080: Easier translation of ElasticSearch mappings page Actual translation of ElasticSearch mappings page contains a huge block with a lot of %s. It makes translation hard. This patch uses new method from Bug 15395 to split into several translation blocks. Test plan : 1) Apply patch "Bug 22080: [DO NOT PUSH] test code" 2) Apply this patch 3) Enable ElasticSearch in SearchEngine preference 4) Go to Administration > Search engine configuration 5) Check page is OK 6) Update the PO files of a language : perl translate update xx-YY 7) Write translation strings in misc/translator/po/xx-YY-messages.po 8) Install translation : perl translate install xx-YY 9) Check translated page --- .../searchengine/elasticsearch/mappings.tt | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt index bb2ade3ea6..cf96b98d33 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt @@ -1,5 +1,6 @@ [% USE raw %] [% USE Asset %] +[% PROCESS 'i18n.inc' %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Search engine configuration [% INCLUDE 'doc-head-close.inc' %] @@ -75,22 +76,22 @@ a.add, a.delete {
[% SWITCH m.code %] [% CASE 'error_on_update' %] - An error occurred when updating mappings ([% m.message | html %]). + [% tx("An error occurred when updating mappings: {message}.", { message = m.message }) | html %] [% CASE 'error_on_delete' %] - An error occurred when deleting the existing mappings. Nothing has been changed! - (search field [% m.values.field_name | html %] with mapping [% m.values.marc_field | html %].) + [% t("An error occurred when deleting the existing mappings. Nothing has been changed!") %] + [% tx("(search field {field_name} with mapping {marc_field}.)", { field_name = m.values.field_name, marc_field = m.values.marc_field }) | html %] [% CASE 'invalid_field_weight' %] - Invalid field weight "[% m.weight | html %]", must be a positive decimal number. + [% tx("Invalid field weight '{weight}', must be a positive decimal number.", { weight = m.weight }) | html %] [% CASE 'error_on_update_es_mappings' %] - An error occurred when updating Elasticsearch index mappings: [% m.message | html %]. + [% tx("An error occurred when updating Elasticsearch index mappings: {message}.", { message = m.message }) | html %] [% CASE 'reindex_required' %] - Index "[% m.index | html %]" needs to be reindexed + [% tx("Index '{index}' needs to be reindexed.", { index = m.index }) | html %] [% CASE 'recreate_required' %] - Index "[% m.index | html %]" needs to be recreated + [% tx("Index '{index}' needs to be recreated.", { index = m.index }) | html %] [% CASE 'success_on_update' %] - Mappings updated successfully. + [% t("Mappings updated successfully.") %] [% CASE 'success_on_reset' %] - Mappings have been reset successfully. + [% t("Mappings have been reset successfully.") %] [% CASE %] [% m.code | html %] [% END %] @@ -115,9 +116,9 @@ a.add, a.delete { [% FOREACH e IN errors %]
  • [% IF ( e.type == "malformed_mapping" ) %] - The value "[% e.value | html %]" is not supported for mappings + The value "[% e.value | html %]" is not supported for mappings [% ELSIF ( e.type == "no_mapping" ) %] - There is no mapping for the index [% e.value | html %] + There is no mapping for the index [% e.value | html %] [% END %]
  • [% END %] -- 2.17.1