From 884467bf481a4c77d0dae5a7add47ebc828f17ce Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Tue, 30 May 2017 17:50:57 +0200 Subject: [PATCH] Bug 18701: Translatability: Get rid of exposed tt directives in matching-rules.tt Translation for file matching-rules.tt exposes a lot of template directives. Translators should not be confronted with internal code like the following: [%% PROCESS norms_select selected_norm=\"none\" id=\"mc_1_src_c_1_n_1_norm\" "name=\"mc_1_src_c_1_n_1_norm\" %%] To test: - Apply patch - Verify that code changes make sense (removes line breaks in directives) - Run QA tools in newset version (tests for line breaks in tt) - Bonus test: create a new translation e.g. fpr language 'aa-AA', verify that such lines no longer appear in po/aa-AA-staff-prog.po (for matching-rules.tt) Signed-off-by: Jonathan Druart (cherry picked from commit 1a023a670c1bf0faffe51faefc42fdd6407c2320) Signed-off-by: Fridolin Somers --- .../prog/en/modules/admin/matching-rules.tt | 57 ++++--------------- 1 file changed, 12 insertions(+), 45 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt index f6a33ad1c3..640e6a2577 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt @@ -328,11 +328,8 @@ function CheckRuleForm(f) { [% FOREACH norm IN component.norms %]
  • - [% PROCESS norms_select - selected_norm=norm.norm - id="mp_${norm.mp_num}_c_${component.comp_num}_n__${norm.norm_num}_norm" - name="mp_${matchpoint.mp_num}_c_${component.comp_num}_n_${norm.norm_num}_norm" - %] + [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %] + [% PROCESS norms_select selected_norm=norm.norm id="mp_${norm.mp_num}_c_${component.comp_num}_n__${norm.norm_num}_norm" name="mp_${matchpoint.mp_num}_c_${component.comp_num}_n_${norm.norm_num}_norm" %]
  • [% END %] @@ -380,11 +377,7 @@ function CheckRuleForm(f) {
  • - [% PROCESS norms_select - selected_norm="none" - id="mp_1_c_1_n_1_norm" - name="mp_1_c_1_n_1_norm" - %] + [% PROCESS norms_select selected_norm="none" id="mp_1_c_1_n_1_norm" name="mp_1_c_1_n_1_norm" %]
  • @@ -441,11 +434,8 @@ function CheckRuleForm(f) { [% FOREACH norm IN src_component.norms %]
  • - [% PROCESS norms_select - selected_norm=norm.norm - id="mc_${matchcheck.mc_num}_src_c_${src_component.comp_num}_n_${norm.norm_num}_norm" - name="mc_${matchcheck.mc_num}_src_c_${src_component.comp_num}_n_${norm.norm_num}_norm" - %] + [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %] + [% PROCESS norms_select selected_norm=norm.norm id="mc_${matchcheck.mc_num}_src_c_${src_component.comp_num}_n_${norm.norm_num}_norm" name="mc_${matchcheck.mc_num}_src_c_${src_component.comp_num}_n_${norm.norm_num}_norm" %]
  • [% END %] @@ -486,11 +476,8 @@ function CheckRuleForm(f) { [% FOREACH norm IN tgt_component.norms %]
  • - [% PROCESS norms_select - selected_norm=norm.norm - id="mc_${matchcheck.mc_num}_tgt_c_${tgt_component.comp_num}_n_${norm.norm_num}_norm" - name="mc_${matchcheck.mc_num}_tgt_c_${tgt_component.comp_num}_n_${norm.norm_num}_norm" - %] + [%# Note: Following directive in one line, otherwise we have translatabiltiy problems %] + [% PROCESS norms_select selected_norm=norm.norm id="mc_${matchcheck.mc_num}_tgt_c_${tgt_component.comp_num}_n_${norm.norm_num}_norm" name="mc_${matchcheck.mc_num}_tgt_c_${tgt_component.comp_num}_n_${norm.norm_num}_norm" %]
  • [% END %] @@ -526,11 +513,7 @@ function CheckRuleForm(f) {
  • - [% PROCESS norms_select - selected_norm="none" - id="mc_1_src_c_1_n_1_norm" - name="mc_1_src_c_1_n_1_norm" - %] +i [% PROCESS norms_select selected_norm="none" id="mc_1_src_c_1_n_1_norm" name="mc_1_src_c_1_n_1_norm" %]
  • @@ -556,11 +539,7 @@ function CheckRuleForm(f) {
  • - [% PROCESS norms_select - selected_norm="none" - id="mc_1_tgt_c_1_n_1_norm" - name="mc_1_tgt_c_1_n_1_norm" - %] + [% PROCESS norms_select selected_norm="none" id="mc_1_tgt_c_1_n_1_norm" name="mc_1_tgt_c_1_n_1_norm" %]
  • @@ -671,11 +650,7 @@ function CheckRuleForm(f) {
  • - [% PROCESS norms_select - selected_norm="none" - id="mp_num_c_1_n_1_norm" - name="mp_num_c_1_n_1_norm" - %] + [% PROCESS norms_select selected_norm="none" id="mp_num_c_1_n_1_norm" name="mp_num_c_1_n_1_norm" %]
  • @@ -708,11 +683,7 @@ function CheckRuleForm(f) {
  • - [% PROCESS norms_select - selected_norm="none" - id="mc_num_src_c_1_n_1_norm" - name="mc_num_src_c_1_n_1_norm" - %] + [% PROCESS norms_select selected_norm="none" id="mc_num_src_c_1_n_1_norm" name="mc_num_src_c_1_n_1_norm" %]
  • @@ -737,11 +708,7 @@ function CheckRuleForm(f) {
  • - [% PROCESS norms_select - selected_norm="none" - id="mc_num_tgt_c_1_n_1_norm" - name="mc_num_tgt_c_1_n_1_norm" - %] + [% PROCESS norms_select selected_norm="none" id="mc_num_tgt_c_1_n_1_norm" name="mc_num_tgt_c_1_n_1_norm" %]
  • -- 2.39.5