f6689fad by Udo Bretz

Marked strings as translatable. Thanks to Balázs Úr!

1 parent 87c1fae0
......@@ -11,6 +11,7 @@ package Kernel::Modules::AgentITSMConfigItem;
use strict;
use warnings;
use Kernel::Language qw(Translatable);
use Kernel::System::VariableCheck qw(:all);
our $ObjectManagerDisabled = 1;
......@@ -205,8 +206,8 @@ sub Run {
# check if filter is valid
if ( !$Filters{ $Self->{Filter} } ) {
return $LayoutObject->ErrorScreen(
Message => 'No access to Class is given!',
Comment => 'Please contact the admin.',
Message => Translatable('No access to Class is given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -215,7 +216,7 @@ sub Run {
# output header
my $Output = $LayoutObject->Header(
Title => 'Overview',
Title => Translatable('Overview'),
Refresh => $Refresh,
);
$Output .= $LayoutObject->NavigationBar();
......@@ -308,8 +309,7 @@ sub Run {
Filter => $Self->{Filter},
Filters => \%NavBarFilter,
FilterLink => $LinkFilter,
TitleName => $LayoutObject->{LanguageObject}->Translate('Overview')
. ': ' . $LayoutObject->{LanguageObject}->Translate('ITSM ConfigItem'),
TitleName => $LayoutObject->{LanguageObject}->Translate('Overview: ITSM ConfigItem'),
TitleValue => $Filters{ $Self->{Filter} }->{Name},
Env => $Self,
LinkPage => $LinkPage,
......
......@@ -11,6 +11,7 @@ package Kernel::Modules::AgentITSMConfigItemAdd;
use strict;
use warnings;
use Kernel::Language qw(Translatable);
our $ObjectManagerDisabled = 1;
sub new {
......@@ -68,7 +69,9 @@ sub Run {
}
# output header
my $Output = $LayoutObject->Header( Title => 'Add' );
my $Output = $LayoutObject->Header(
Title => Translatable('Add'),
);
$Output .= $LayoutObject->NavigationBar();
# output overview
......
......@@ -10,6 +10,7 @@ package Kernel::Modules::AgentITSMConfigItemBulk;
use strict;
use warnings;
use Kernel::Language qw(Translatable);
use Kernel::System::VariableCheck qw(:all);
our $ObjectManagerDisabled = 1;
......@@ -34,7 +35,7 @@ sub Run {
# check if bulk feature is enabled
if ( !$ConfigObject->Get('ITSMConfigItem::Frontend::BulkFeature') ) {
return $LayoutObject->ErrorScreen(
Message => 'Bulk feature is not enabled!',
Message => Translatable('Bulk feature is not enabled!'),
);
}
......@@ -48,8 +49,8 @@ sub Run {
# check needed stuff
if ( !@ConfigItemIDs ) {
return $LayoutObject->ErrorScreen(
Message => 'No ConfigItemID is given!',
Comment => 'You need at least one selected Configuration Item!',
Message => Translatable('No ConfigItemID is given!'),
Comment => Translatable('You need at least one selected Configuration Item!'),
);
}
my $Output .= $LayoutObject->Header(
......@@ -122,8 +123,10 @@ sub Run {
# error screen, don't show config item
$Output .= $LayoutObject->Notify(
Data => $ConfigItem->{Number}
. ': $Text{"You don\'t have write access to this configuration item."}',
Data => $LayoutObject->{LanguageObject}->Translate(
'You don\'t have write access to this configuration item: %s.',
$ConfigItem->{Number},
),
);
next CONFIGITEM_ID;
}
......
......@@ -10,6 +10,8 @@ package Kernel::Modules::AgentITSMConfigItemDelete;
use strict;
use warnings;
use Kernel::Language qw(Translatable);
our $ObjectManagerDisabled = 1;
sub new {
......@@ -34,8 +36,8 @@ sub Run {
# check needed stuff
if ( !$ConfigItemID ) {
return $LayoutObject->ErrorScreen(
Message => 'No ConfigItemID is given!',
Comment => 'Please contact the admin.',
Message => Translatable('No ConfigItemID is given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -57,7 +59,7 @@ sub Run {
# error screen
if ( !$Access ) {
return $LayoutObject->NoPermission(
Message => "You need $Self->{Config}->{Permission} permissions!",
Message => $LayoutObject->{LanguageObject}->Translate( 'You need %s permissions!', $Self->{Config}->{Permission} ),
WithHeader => 'yes',
);
}
......@@ -71,8 +73,8 @@ sub Run {
# check if config item is found
if ( !$ConfigItem ) {
return $LayoutObject->ErrorScreen(
Message => "Config item '$ConfigItemID' not found in database!",
Comment => 'Please contact the admin.',
Message => $LayoutObject->{LanguageObject}->Translate( 'Config item "%s" not found in database!', $ConfigItemID ),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -96,8 +98,8 @@ sub Run {
# show error message, when delete failed
return $LayoutObject->ErrorScreen(
Message => "Was not able to delete the configitem ID $ConfigItemID!",
Comment => 'Please contact the administrator.',
Message => $LayoutObject->{LanguageObject}->Translate( 'Was not able to delete the configitem ID %s!', $ConfigItemID ),
Comment => Translatable('Please contact the administrator.'),
);
}
}
......@@ -109,8 +111,8 @@ sub Run {
if ( !$Version->{VersionID} ) {
return $LayoutObject->ErrorScreen(
Message => "No Version found for ConfigItemID $ConfigItemID!",
Comment => 'Please contact the admin.',
Message => $LayoutObject->{LanguageObject}->Translate( 'No version found for ConfigItemID %s!', $ConfigItemID ),
Comment => Translatable('Please contact the administrator.'),
);
}
......
......@@ -106,16 +106,16 @@ sub Run {
}
else {
return $LayoutObject->ErrorScreen(
Message => 'No ConfigItemID, DuplicateID or ClassID is given!',
Comment => 'Please contact the admin.',
Message => Translatable('No ConfigItemID, DuplicateID or ClassID is given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
# if user has no access rights show error page
if ( !$HasAccess ) {
return $LayoutObject->ErrorScreen(
Message => 'No access is given!',
Comment => 'Please contact the admin.',
Message => Translatable('No access is given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -127,8 +127,8 @@ sub Run {
# abort, if no definition is defined
if ( !$XMLDefinition->{DefinitionID} ) {
return $LayoutObject->ErrorScreen(
Message => "No Definition was defined for class $ConfigItem->{Class}!",
Comment => 'Please contact the admin.',
Message => $LayoutObject->{LanguageObject}->Translate( 'No definition was defined for class %s!', $ConfigItem->{Class} ),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -639,7 +639,7 @@ sub Run {
# output header
$Output .= $LayoutObject->Header(
Title => 'Edit',
Title => Translatable('Edit'),
Type => 'Small',
);
......@@ -700,7 +700,9 @@ sub Run {
$LayoutObject->Block( Name => 'EndNormal' );
# output header
$Output .= $LayoutObject->Header( Title => 'Edit' );
$Output .= $LayoutObject->Header(
Title => Translatable('Edit'),
);
$Output .= $LayoutObject->NavigationBar();
# start template output
......
......@@ -11,6 +11,8 @@ package Kernel::Modules::AgentITSMConfigItemHistory;
use strict;
use warnings;
use Kernel::Language qw(Translatable);
our $ObjectManagerDisabled = 1;
sub new {
......@@ -37,8 +39,8 @@ sub Run {
# error page
return $LayoutObject->ErrorScreen(
Message => 'Can\'t show history, no ConfigItemID is given!',
Comment => 'Please contact the admin.',
Message => Translatable('Can\'t show history, no ConfigItemID is given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -58,8 +60,8 @@ sub Run {
# error page
return $LayoutObject->ErrorScreen(
Message => 'Can\'t show history, no access rights given!',
Comment => 'Please contact the admin.',
Message => Translatable('Can\'t show history, no access rights given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......
......@@ -11,6 +11,8 @@ package Kernel::Modules::AgentITSMConfigItemPrint;
use strict;
use warnings;
use Kernel::Language qw(Translatable);
our $ObjectManagerDisabled = 1;
sub new {
......@@ -39,8 +41,8 @@ sub Run {
# check needed stuff
if ( !$ConfigItemID || !$VersionID ) {
return $LayoutObject->ErrorScreen(
Message => 'No ConfigItemID or VersionID is given!',
Comment => 'Please contact the admin.',
Message => Translatable('No ConfigItemID or VersionID is given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -60,8 +62,8 @@ sub Run {
# error page
return $LayoutObject->ErrorScreen(
Message => 'Can\'t show config item, no access rights given!',
Comment => 'Please contact the admin.',
Message => Translatable('Can\'t show config item, no access rights given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -71,8 +73,8 @@ sub Run {
);
if ( !$ConfigItem->{ConfigItemID} ) {
return $LayoutObject->ErrorScreen(
Message => "ConfigItemID $ConfigItemID not found in database!",
Comment => 'Please contact the admin.',
Message => $LayoutObject->{LanguageObject}->Translate( 'ConfigItemID %s not found in database!', $ConfigItemID ),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -82,8 +84,8 @@ sub Run {
);
if ( !$Version->{VersionID} ) {
return $LayoutObject->ErrorScreen(
Message => "VersionID $VersionID not found in database!",
Comment => 'Please contact the admin.',
Message => $LayoutObject->{LanguageObject}->Translate( 'VersionID %s not found in database!', $VersionID ),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -205,9 +207,11 @@ sub Run {
# output "printed by"
$PDFObject->Text(
Text => $LayoutObject->{LanguageObject}->Translate('printed by') . ' '
. $Self->{UserFullname} . ' '
. $LayoutObject->{Time},
Text => $LayoutObject->{LanguageObject}->Translate(
'printed by %s at %s',
$Self->{UserFullname},
$LayoutObject->{Time},
),
FontSize => 9,
);
......
......@@ -11,6 +11,7 @@ package Kernel::Modules::AgentITSMConfigItemSearch;
use strict;
use warnings;
use Kernel::Language qw(Translatable);
use Kernel::System::VariableCheck qw(:all);
our $ObjectManagerDisabled = 1;
......@@ -83,8 +84,8 @@ sub Run {
# check if class id is valid
if ( $ClassID && !$ClassList->{$ClassID} ) {
return $LayoutObject->ErrorScreen(
Message => 'Invalid ClassID!',
Comment => 'Please contact the admin.',
Message => Translatable('Invalid ClassID!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -137,7 +138,7 @@ sub Run {
Name => 'SearchClassID',
PossibleNone => 1,
SelectedID => $ClassID || '',
Translation => 0,
Translation => 1,
Class => 'Modernize',
);
......@@ -181,8 +182,8 @@ sub Run {
# ClassID is required for the search mask and for actual searching
if ( !$ClassID ) {
return $LayoutObject->ErrorScreen(
Message => 'No ClassID is given!',
Comment => 'Please contact the admin.',
Message => Translatable('No ClassID is given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -197,8 +198,8 @@ sub Run {
# show error screen
if ( !$HasAccess ) {
return $LayoutObject->ErrorScreen(
Message => 'No access rights for this class given!',
Comment => 'Please contact the admin.',
Message => Translatable('No access rights for this class given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -210,27 +211,27 @@ sub Run {
# abort, if no definition is defined
if ( !$XMLDefinition->{DefinitionID} ) {
return $LayoutObject->ErrorScreen(
Message => "No Definition was defined for class $ClassID!",
Comment => 'Please contact the admin.',
Message => $LayoutObject->{LanguageObject}->Translate( 'No definition was defined for class %s!', $ClassID ),
Comment => Translatable('Please contact the administrator.'),
);
}
my @XMLAttributes = (
{
Key => 'Number',
Value => 'Number',
Value => Translatable('Number'),
},
{
Key => 'Name',
Value => 'Name',
Value => Translatable('Name'),
},
{
Key => 'DeplStateIDs',
Value => 'Deployment State',
Value => Translatable('Deployment State'),
},
{
Key => 'InciStateIDs',
Value => 'Incident State',
Value => Translatable('Incident State'),
},
);
......@@ -314,8 +315,8 @@ sub Run {
my $PreviousVersionOptionStrg = $LayoutObject->BuildSelection(
Name => 'PreviousVersionSearch',
Data => {
0 => 'No',
1 => 'Yes',
0 => Translatable('No'),
1 => Translatable('Yes'),
},
SelectedID => $GetParam{PreviousVersionSearch} || '0',
Class => 'Modernize',
......@@ -324,9 +325,9 @@ sub Run {
# build output format string
$Param{ResultFormStrg} = $LayoutObject->BuildSelection(
Data => {
Normal => 'Normal',
Print => 'Print',
CSV => 'CSV',
Normal => Translatable('Normal'),
Print => Translatable('Print'),
CSV => Translatable('CSV'),
},
Name => 'ResultForm',
SelectedID => $GetParam{ResultForm} || 'Normal',
......@@ -438,8 +439,8 @@ sub Run {
# ClassID is required for the search mask and for actual searching
if ( !$ClassID ) {
return $LayoutObject->ErrorScreen(
Message => 'No ClassID is given!',
Comment => 'Please contact the admin.',
Message => Translatable('No ClassID is given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -454,8 +455,8 @@ sub Run {
# show error screen
if ( !$HasAccess ) {
return $LayoutObject->ErrorScreen(
Message => 'No access rights for this class given!',
Comment => 'Please contact the admin.',
Message => Translatable('No access rights for this class given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -467,8 +468,8 @@ sub Run {
# abort, if no definition is defined
if ( !$XMLDefinition->{DefinitionID} ) {
return $LayoutObject->ErrorScreen(
Message => "No Definition was defined for class $ClassID!",
Comment => 'Please contact the admin.',
Message => $LayoutObject->{LanguageObject}->Translate( 'No definition was defined for class %s!', $ClassID ),
Comment => Translatable('Please contact the administrator.'),
);
}
......
......@@ -11,6 +11,8 @@ package Kernel::Modules::AgentITSMConfigItemZoom;
use strict;
use warnings;
use Kernel::Language qw(Translatable);
our $ObjectManagerDisabled = 1;
sub new {
......@@ -39,8 +41,8 @@ sub Run {
# check needed stuff
if ( !$ConfigItemID ) {
return $LayoutObject->ErrorScreen(
Message => "No ConfigItemID is given!",
Comment => 'Please contact the admin.',
Message => Translatable('No ConfigItemID is given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -60,8 +62,8 @@ sub Run {
# error page
return $LayoutObject->ErrorScreen(
Message => 'Can\'t show item, no access rights for ConfigItem are given!',
Comment => 'Please contact the admin.',
Message => Translatable('Can\'t show item, no access rights for ConfigItem are given!'),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -77,8 +79,8 @@ sub Run {
);
if ( !$ConfigItem->{ConfigItemID} ) {
return $LayoutObject->ErrorScreen(
Message => "ConfigItemID $ConfigItemID not found in database!",
Comment => 'Please contact the admin.',
Message => $LayoutObject->{LanguageObject}->Translate( 'ConfigItemID %s not found in database!', $ConfigItemID ),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -88,8 +90,8 @@ sub Run {
);
if ( !$VersionList->[0]->{VersionID} ) {
return $LayoutObject->ErrorScreen(
Message => "No Version found for ConfigItemID $ConfigItemID!",
Comment => 'Please contact the admin.',
Message => $LayoutObject->{LanguageObject}->Translate( 'No version found for ConfigItemID %s!', $ConfigItemID ),
Comment => Translatable('Please contact the administrator.'),
);
}
......@@ -294,8 +296,8 @@ sub Run {
$LayoutObject->Block(
Name => 'Data',
Data => {
Name => 'Name',
Description => 'The name of this config item',
Name => Translatable('Name'),
Description => Translatable('The name of this config item'),
Value => $Version->{Name},
Identation => 10,
},
......@@ -305,8 +307,8 @@ sub Run {
$LayoutObject->Block(
Name => 'Data',
Data => {
Name => 'Deployment State',
Description => 'The deployment state of this config item',
Name => Translatable('Deployment State'),
Description => Translatable('The deployment state of this config item'),
Value => $LayoutObject->{LanguageObject}->Translate(
$Version->{DeplState},
),
......@@ -318,8 +320,8 @@ sub Run {
$LayoutObject->Block(
Name => 'Data',
Data => {
Name => 'Incident State',
Description => 'The incident state of this config item',
Name => Translatable('Incident State'),
Description => Translatable('The incident state of this config item'),
Value => $LayoutObject->{LanguageObject}->Translate(
$Version->{InciState},
),
......
......@@ -12,6 +12,7 @@ use strict;
use warnings;
use List::Util qw(min);
use Kernel::Language qw(Translatable);
use Kernel::System::VariableCheck qw(:all);
our @ObjectDependencies = (
......@@ -84,7 +85,7 @@ sub ObjectAttributesGet {
my $Attributes = [
{
Key => 'ClassID',
Name => 'Class',
Name => Translatable('Class'),
Input => {
Type => 'Selection',
Data => $ClassList,
......@@ -95,7 +96,7 @@ sub ObjectAttributesGet {
},
{
Key => 'CountMax',
Name => 'Maximum number of one element',
Name => Translatable('Maximum number of one element'),
Input => {
Type => 'Text',
ValueDefault => '10',
......@@ -109,7 +110,7 @@ sub ObjectAttributesGet {
},
{
Key => 'EmptyFieldsLeaveTheOldValues',
Name => 'Empty fields indicate that the current values are kept',
Name => Translatable('Empty fields indicate that the current values are kept'),
Input => {
Type => 'Checkbox',
},
......@@ -167,19 +168,19 @@ sub MappingObjectAttributesGet {
my $ElementList = [
{
Key => 'Number',
Value => 'Number',
Value => Translatable('Number'),
},
{
Key => 'Name',
Value => 'Name',
Value => Translatable('Name'),
},
{
Key => 'DeplState',
Value => 'Deployment State',
Value => Translatable('Deployment State'),
},
{
Key => 'InciState',
Value => 'Incident State',
Value => Translatable('Incident State'),
},
];
......@@ -193,7 +194,7 @@ sub MappingObjectAttributesGet {
my $Attributes = [
{
Key => 'Key',
Name => 'Key',
Name => Translatable('Key'),
Input => {
Type => 'Selection',
Data => $ElementList,
......@@ -204,7 +205,7 @@ sub MappingObjectAttributesGet {
},
{
Key => 'Identifier',
Name => 'Identifier',
Name => Translatable('Identifier'),
Input => {
Type => 'Checkbox',
},
......@@ -272,7 +273,7 @@ sub SearchAttributesGet {
my $AttributeList = [
{
Key => 'Number',
Name => 'Number',
Name => Translatable('Number'),
Input => {
Type => 'Text',
Size => 80,
......@@ -281,7 +282,7 @@ sub SearchAttributesGet {
},
{
Key => 'Name',
Name => 'Name',
Name => Translatable('Name'),
Input => {
Type => 'Text',
Size => 80,
......@@ -290,7 +291,7 @@ sub SearchAttributesGet {
},
{
Key => 'DeplStateIDs',
Name => 'Deployment State',
Name => Translatable('Deployment State'),
Input => {
Type => 'Selection',
Data => $DeplStateList,
......@@ -301,7 +302,7 @@ sub SearchAttributesGet {
},
{
Key => 'InciStateIDs',
Name => 'Incident State',
Name => Translatable('Incident State'),
Input => {
Type => 'Selection',
Data => $InciStateList,
......