Znuny/Znuny LTS is a fork of the ((OTRS)) Community Edition, one of the most flexible web-based ticketing systems used for Customer Service, Help Desk, IT Service Management.
E.g. in ticket history german speaking users can see the entry 'Status geändert von "new" auf "open".', so the
states aren't translated. This new feature for Translate() allows to define a subroutine where those parameters (e.g. 'new' and 'open')
can be translated or replaced. This is fully backwards-compatible.
To use this feature, one has to pass an array ref in the translation definition. The first
value has to be the translation string and the second one is a subroutine reference:
package Kernel::Language::de_Parameters;
use strict;
use warnings;
use utf8;
sub Data {
my = shift;
->{Translation}->{'Changed state from "%s" to "%s".'} = [
'Status geändert von "%s" auf "%s".',
\&TranslateStates,
];
return 1;
}
sub TranslateStates {
my = ::OM->Get('Kernel::Language');
reneeb = ->Translate( reneeb ) for @_;
return @_;
}
1;
This shows for the above mentioned string Status geändert von "neu" auf "offen".'. So it's more consistent as the same values are shown to the Agent in all places.
'1 - 🚀 feature' - New feature (which adds functionality to an existing integration)
Breaking change
Additional information
Checklist
[X] The code change is tested and works locally.(❗)
[ ] There is no commented out code in this PR.(❕)
[X] You improved or added new unit tests.(❕)
[ ] Local ZnunyCodePolicy passed.(❕)
[ ] Local UnitTests / Selenium passed.(❕)
[ ] GitHub workflow CI (UnitTests / Selenium) passed.(❗)
Proposed change
E.g. in ticket history german speaking users can see the entry 'Status geändert von "new" auf "open".', so the states aren't translated. This new feature for Translate() allows to define a subroutine where those parameters (e.g. 'new' and 'open') can be translated or replaced. This is fully backwards-compatible.
To use this feature, one has to pass an array ref in the translation definition. The first value has to be the translation string and the second one is a subroutine reference:
This shows for the above mentioned string Status geändert von "neu" auf "offen".'. So it's more consistent as the same values are shown to the Agent in all places.
Breaking change
Additional information
Checklist