Skip to content

Commit

Permalink
Issue #3658: Automaticaly generate chained translations for queues an…
Browse files Browse the repository at this point in the history
…d services when deploying translations.
  • Loading branch information
stefanhaerter authored and svenoe committed Jul 31, 2024
1 parent d724338 commit e18f8b4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Kernel/System/Translations.pm
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,30 @@ EOF
$Success = 1;
}

# # generate chained translations for queues and services automatically
my %SystemLanguages = %{ $Kernel::OM->Get('Kernel::Config')->Get('DefaultUsedLanguages') };

# NOTE valid defaults to 1
my %Queues = $Kernel::OM->Get('Kernel::System::Queue')->QueueList();
my @Strings = values %Queues;

if ( $Kernel::OM->Get('Kernel::Config')->Get('Ticket::Service') ) {

# NOTE valid defaults to 1
my %Services = $Kernel::OM->Get('Kernel::System::Service')->ServiceList(
UserID => 1,
);
push @Strings, values %Services;
}

# iterate over all languages
for my $LanguageID ( sort keys %SystemLanguages ) {
$Self->TranslateChainedElements(
LanguageID => $LanguageID,
Strings => \@Strings,
);
}

return $Success;
}

Expand Down

0 comments on commit e18f8b4

Please sign in to comment.