From 666f71e3e19e0eebc9c374ec926821854370f124 Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Mon, 4 Apr 2016 14:01:17 -0300 Subject: [PATCH] Bug 16144: Remove 'dt_*' from translation strings when possible This patch removes strings form translation files that have 'dt_*' variables besides puntuation, html constructs, etc. To test: 1) Update strings for any language 2) Check for strings with 'dt_*', eg. for es-ES msgcat --no-wrap po/es-ES-staff-prog.po | egrep ^msgid | egrep "dt_" 3) Apply the patch & update again 4) Compare similar strings, there are now a few less strings This does not remove all occurrences, there's no easy way to do that. --- misc/translator/xgettext.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl index 8d55547..12ccdce 100755 --- a/misc/translator/xgettext.pl +++ b/misc/translator/xgettext.pl @@ -39,7 +39,7 @@ sub string_negligible_p { || $t =~ /^\d+$/ # purely digits || $t =~ /^[-\+\.,:;!\?'"%\(\)\[\]\|]+$/ # punctuation w/o context || $t =~ /^[A-Za-z]$/ # single letters - || $t =~ /^(&[a-z]+;|&#\d+;|&#x[0-9a-fA-F]+;|%%|%s|\s|[[:punct:]])*$/ # html entities,placeholder,punct, ... + || $t =~ /^(&[a-z]+;|&#\d+;|&#x[0-9a-fA-F]+;|%%|%s|\s|[[:punct:]]|dt_\w+)*$/ # html entities,placeholder,punct, ... || ( $t =~ /^\[\%.*\%\]$/ and $t !~ /\%\].*\[\%/ ) # pure TT entities ) } -- 1.9.1