From c00809a1c234792b41a67ae33dc9aa1797cd76f4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 9 Jan 2025 22:47:53 +0100 Subject: [PATCH] Bug 38664: WIP trim msgid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Test the translation process * Confirm that the changes make sense ``` - + ``` => Generate ``` +#: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:89 +#, fuzzy, c-format +msgid "Remote-sensing image " +msgstr "Image de télédétection" ``` Added a "trim" commit, and it actually fixes some problem with the current script: ``` +#. For the first occurrence, #. SCRIPT -#: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:114 +#: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:139 msgid "b- Large print" msgstr "b- Gros caractères" -#. SCRIPT -#: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_007.tt:114 -msgid "b- Large print " -msgstr "b- Gros caractères " ``` Is that enough? OR we modify prettier's default behaviour: https://prettier.io/docs/en/options.html#html-whitespace-sensitivity Signed-off-by: Katrin Fischer --- misc/translator/TmplTokenizer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/translator/TmplTokenizer.pm b/misc/translator/TmplTokenizer.pm index 1e95c54879..6b85486e4b 100644 --- a/misc/translator/TmplTokenizer.pm +++ b/misc/translator/TmplTokenizer.pm @@ -226,7 +226,7 @@ sub string_canon { my $s = shift; # Fold all whitespace into single blanks $s =~ s/\s+/ /g; - $s =~ s/^\s+//g; + $s =~ s/^\s+|\s+$//g; return $s; }