Translation#
NAME#
Kernel::System::Translation - Translation lib
SYNOPSIS#
All Translation functions
PUBLIC INTERFACE#
new()#
create an object
my $TranslationObject = $Kernel::OM->Get('Kernel::System::Translation');
DataDeployment()#
Deploys all translations.
my $Success = $TranslationObject->DataDeployment(
UserID => 1,
);
Returns:
my $Success = 1;
TranslationFilesDelete()#
Deletes all translation files
my $Success = $TranslationObject->TranslationFilesDelete();
Returns:
my $Success = 1;
DataExport()#
exports data.
my $Export = $TranslationObject->DataExport(
Format => 'yml',
Cache => 0,
);
Returns:
my $Export = 'STRING';
DataImport()#
imports data.
my $Success = $TranslationObject->DataImport(
Content => $ContentString,
Format => 'yml', # optional - default
);
Returns:
my $Success = 1;
DataAdd()#
creates data attributes
my $CreatedID = $TranslationObject->DataAdd(
ID => '...',
LanguageID => '...',
Source => '...',
Destination => '...',
ValidID => '...',
CreateTime => '...',
CreateBy => '...',
ChangeTime => '...',
ChangeBy => '...',
DeploymentState => '...',
UserID => 1,
);
Returns:
my $CreatedID = 1;
DataGet()#
get data attributes
my %Data = $TranslationObject->DataGet(
ID => '...', # optional
LanguageID => '...', # optional
Source => '...', # optional
Destination => '...', # optional
ValidID => '...', # optional
CreateTime => '...', # optional
CreateBy => '...', # optional
ChangeTime => '...', # optional
ChangeBy => '...', # optional
DeploymentState => '...', # optional
UserID => 1,
);
Returns:
my %Data = (
ID => '...',
LanguageID => '...',
Source => '...',
Destination => '...',
ValidID => '...',
CreateTime => '...',
CreateBy => '...',
ChangeTime => '...',
ChangeBy => '...',
DeploymentState => '...',
);
DataListGet()#
get list data with attributes
my @Data = $TranslationObject->DataListGet(
ID => '...', # optional
LanguageID => '...', # optional
Source => '...', # optional
Destination => '...', # optional
ValidID => '...', # optional
CreateTime => '...', # optional
CreateBy => '...', # optional
ChangeTime => '...', # optional
ChangeBy => '...', # optional
DeploymentState => '...', # optional
UserID => 1,
);
Returns:
my @Data = (
{
ID => '...',
LanguageID => '...',
Source => '...',
Destination => '...',
ValidID => '...',
CreateTime => '...',
CreateBy => '...',
ChangeTime => '...',
ChangeBy => '...',
DeploymentState => '...',
},
...
);
DataUpdate()#
update data attributes
my $Success = $TranslationObject->DataUpdate(
ID => 1234,
UserID => 1,
# all other attributes are optional
);
Returns:
my $Success = 1; # 1|0
DataNameExists()#
checks if a entry with the given name exists
my $NameExists = $TranslationObject->DataNameExists(
ID => 1234,
Name => '...',
UserID => 1,
);
Returns:
my $NameExists = 1; # 1|0
DataDelete()#
deletes data attributes - at least one is required.
my $Success = $TranslationObject->DataDelete(
ID => '...', # optional
LanguageID => '...', # optional
Source => '...', # optional
Destination => '...', # optional
ValidID => '...', # optional
CreateTime => '...', # optional
CreateBy => '...', # optional
ChangeTime => '...', # optional
ChangeBy => '...', # optional
DeploymentState => '...', # optional
UserID => 1,
);
Returns:
my $Success = 1; # 1|0
DataSearch()#
search for value in defined attributes
my %Data = $TranslationObject->DataSearch(
Search => 'test*test',
ID => '...', # optional
LanguageID => '...', # optional
Source => '...', # optional
Destination => '...', # optional
ValidID => '...', # optional
CreateTime => '...', # optional
CreateBy => '...', # optional
ChangeTime => '...', # optional
ChangeBy => '...', # optional
DeploymentState => '...', # optional
UserID => 1,
);
Returns:
my %Data = (
'1' => {
'ID' => '...',
'LanguageID' => '...',
'Source' => '...',
'Destination' => '...',
'ValidID' => '...',
'CreateTime' => '...',
'CreateBy' => '...',
'ChangeTime' => '...',
'ChangeBy' => '...',
'DeploymentState' => '...',
},
...
);
InitConfig()#
init config for object
my $Success = $TranslationObject->InitConfig();
Returns:
my $Success = 1;