Skip to content

Commit

Permalink
fix settings translations (stream-labs#4089)
Browse files Browse the repository at this point in the history
  • Loading branch information
holiber authored Apr 12, 2022
1 parent e546951 commit 7b2fe0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/services/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ export function $t(...args: any[]): string {
* get localized string from dictionary if exists
* returns a keypath if localized version of string doesn't exist
*/
export function $translateIfExist(str: string): string {
// TODO: Call into worker window instead
// const vueI18nInstance = I18nService.vueI18nInstance;
// if (vueI18nInstance.te(str)) return $t(str);
return str;
export function $translateIfExist(...args: any[]): string {
const locale = I18nService.instance.state.locale;
const messages = I18nService.vueI18nInstance.messages[locale];
const hasTranslation = !!messages[args[0]];
return hasTranslation ? $t(...args) : args[0];
}

/**
Expand Down

0 comments on commit 7b2fe0f

Please sign in to comment.