Bugzilla – Attachment 138452 Details for
Bug 28707
Missing strings in translation of sample data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28707: Translate RECEIPT notice
Bug-28707-Translate-RECEIPT-notice.patch (text/plain), 2.89 KB, created by
Jonathan Druart
on 2022-08-01 09:07:30 UTC
(
hide
)
Description:
Bug 28707: Translate RECEIPT notice
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-08-01 09:07:30 UTC
Size:
2.89 KB
patch
obsolete
>From 206bb68c98033627f3017bc9f0c3f15e4e28f199 Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Fri, 6 May 2022 19:27:28 -0300 >Subject: [PATCH] Bug 28707: Translate RECEIPT notice > >There is a badly crafted regex used when extracting >strings in multiline fields in yaml files >The regex is my own, introduced in Bug 24262, sorry. > >This patch correct it a little. Better eyes are welcome. > >To test: >1) go to misc translator, update some language > ./translate update fr-CA > >2) check missing strings > > egrep "Total out|Operator ID|August 31" po/fr-CA-installer.po > > first two are from sample notices, third from sample creator data > >3) apply the patch, repeat 1) > >4) repeat 2), verify the strings are present in the translation file > >5) translate some of the new strings, install the language, > verify strings are present in the translated files > ./translate install fr-CA > check fr-CA/optional/sample_creator_data.yml and > fr-CA/mandatory/sample_notices.yml > >There are some 60+ new strings. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > misc/translator/LangInstaller.pm | 2 +- > misc/translator/xgettext-installer | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm >index 8ab863f605f..f5dd1831bad 100644 >--- a/misc/translator/LangInstaller.pm >+++ b/misc/translator/LangInstaller.pm >@@ -318,7 +318,7 @@ sub translate_yaml { > for my $field ( @translatable ) { # each translatable field > if ( @multiline and grep { $_ eq $field } @multiline ) { # multiline fields, only notices ATM > foreach my $line ( @{$row->{$field}} ) { >- next if ( $line =~ /^(\s*<.*?>\s*$|^\s*\[.*?\]\s*|\s*)$/ ); # discard pure html, TT, empty >+ next if ( $line =~ /^(\s*<\/*\w+\s*>|\s*\[.*\]|\s*<.*\[.*\].*>|\s*)$/ ); # discard pure html, TT, empty > my @ttvar; > while ( $line =~ s/(<<.*?>>|\[\%.*?\%\]|<.*?>)/\%s/ ) { # put placeholders, save matches > my $var = $1; >diff --git a/misc/translator/xgettext-installer b/misc/translator/xgettext-installer >index 5fa23faaba1..ecb134b14ae 100755 >--- a/misc/translator/xgettext-installer >+++ b/misc/translator/xgettext-installer >@@ -111,7 +111,7 @@ for my $file (@files) { > $mulc++; > > # discard pure html, TT, empty >- next if ( $line =~ /^(\s*<.*?>\s*$|^\s*\[.*?\]\s*|\s*)$/ ); >+ next if ( $line =~ /^(\s*<\/*\w+\s*>|\s*\[.*\]|\s*<.*\[.*\].*>|\s*)$/ ); > > # put placeholders > $line =~ s/(<<.*?>>|\[\%.*?\%\]|<.*?>)/\%s/g; >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28707
:
134768
|
137798
| 138452