Skip to content

Commit

Permalink
Update custom translations to work without PO file (#2510)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsangmeister authored Jul 11, 2023
1 parent ed9d88c commit ea5c71d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export class OpenSlidesTranslateParser extends TranslateDefaultParser {
*/
public override getValue(target: any, key: string): any {
const translation = super.getValue(target, key);
const customTranslationKey = Object.keys(this.customTranslations).find(original => original === translation);
if (customTranslationKey) {
return this.customTranslations[customTranslationKey];
const customTranslationsKey = translation || key; // use the original string if no translation was found
if (customTranslationsKey && this.customTranslations.hasOwnProperty(customTranslationsKey)) {
return this.customTranslations[customTranslationsKey];
} else {
return translation;
}
Expand Down

0 comments on commit ea5c71d

Please sign in to comment.