Skip Menu |

This queue is for tickets about the RT-Extension-MandatoryOnTransition CPAN distribution.

Report information
The Basics
Id: 103510
Status: resolved
Priority: 0/
Queue: RT-Extension-MandatoryOnTransition

People
Owner: Nobody in particular
Requestors: max [...] tcen.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Simple patch l10n patch
Date: Tue, 14 Apr 2015 00:59:24 +0300
To: bug-RT-Extension-MandatoryOnTransition [...] rt.cpan.org
From: Max Kosmach <max [...] tcen.ru>
Hi Simple patch to add loc() calls for field names and statuses. --- RT-Extension-MandatoryOnTransition/lib/RT/Extension/MandatoryOnTransition.pm.or 2015-04-07 15:09:11.000000000 +0300 +++ RT-Extension-MandatoryOnTransition/lib/RT/Extension/MandatoryOnTransition.pm 2015-04-14 00:48:08.761417833 +0300 @@ -360,7 +360,7 @@ (my $label = $field) =~ s/(?<=[a-z])(?=[A-Z])/ /g; # / push @errors, $CurrentUser->loc("[_1] is required when changing Status to [_2]", - $label, $ARGSRef->{Status}); + $CurrentUser->loc($label), $CurrentUser->loc($ARGSRef->{Status})); } return \@errors unless @$cfs; @@ -417,7 +417,7 @@ push @errors, $CurrentUser->loc("[_1] is required when changing Status to [_2]", - $cf->Name, $ARGSRef->{Status}); + $CurrentUser->loc($cf->Name), $CurrentUser->loc($ARGSRef->{Status})); } return \@errors; -- With best wishes, Max
This patch looks wrong to me as CF names shouldn't be translated. Here is an updated one and the default pot file
Subject: 0001-Add-default-pot-file-for-future-translations.patch
From 4414188660ca8f4248521b35d23fae0fdee01754 Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour <elacour@easter-eggs.com> Date: Mon, 6 Jul 2015 17:59:06 +0200 Subject: [PATCH 1/3] Add default pot file for future translations --- po/mandatoryontransition.pot | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 po/mandatoryontransition.pot diff --git a/po/mandatoryontransition.pot b/po/mandatoryontransition.pot new file mode 100644 index 0000000..78b2f15 --- /dev/null +++ b/po/mandatoryontransition.pot @@ -0,0 +1,6 @@ +#: lib/RT/Extension/MandatoryOnTransition.pm:363 lib/RT/Extension/MandatoryOnTransition.pm:420 +#. ($cf->Name, $ARGSRef->{Status}) +#. ($label, $ARGSRef->{Status}) +msgid "%1 is required when changing Status to %2" +msgstr "" + -- 2.1.4
Subject: 0002-Translate-fields-names-and-statuses.patch
From 3783405cde2b732f3c9ac570c221df283af6ebcd Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour <elacour@easter-eggs.com> Date: Mon, 6 Jul 2015 17:59:55 +0200 Subject: [PATCH 2/3] Translate fields names and statuses --- lib/RT/Extension/MandatoryOnTransition.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/RT/Extension/MandatoryOnTransition.pm b/lib/RT/Extension/MandatoryOnTransition.pm index 7d3fec2..39812e7 100644 --- a/lib/RT/Extension/MandatoryOnTransition.pm +++ b/lib/RT/Extension/MandatoryOnTransition.pm @@ -360,7 +360,7 @@ sub CheckMandatoryFields { (my $label = $field) =~ s/(?<=[a-z])(?=[A-Z])/ /g; # / push @errors, $CurrentUser->loc("[_1] is required when changing Status to [_2]", - $label, $ARGSRef->{Status}); + $CurrentUser->loc($label), $CurrentUser->loc($ARGSRef->{Status})); } return \@errors unless @$cfs; @@ -417,7 +417,7 @@ sub CheckMandatoryFields { push @errors, $CurrentUser->loc("[_1] is required when changing Status to [_2]", - $cf->Name, $ARGSRef->{Status}); + $cf->Name, $CurrentUser->loc($ARGSRef->{Status})); } return \@errors; -- 2.1.4
Hi Max, Thanks for sending in your updates. "loc" support has been added, in a slightly different way, to the latest version released to CPAN. Jim