From 28296a8a630e71776fe5651e7f4853e2f0f4b330 Mon Sep 17 00:00:00 2001 From: DigiLive Date: Sat, 17 May 2025 10:34:29 +0200 Subject: [PATCH] Fix localization for regioned languages --- src/translations/{pt-br.json => pt-BR.json} | 0 src/utilities/localize.ts | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/translations/{pt-br.json => pt-BR.json} (100%) diff --git a/src/translations/pt-br.json b/src/translations/pt-BR.json similarity index 100% rename from src/translations/pt-br.json rename to src/translations/pt-BR.json diff --git a/src/utilities/localize.ts b/src/utilities/localize.ts index 6e3fef6..7dfc803 100644 --- a/src/utilities/localize.ts +++ b/src/utilities/localize.ts @@ -2,7 +2,7 @@ import * as de from '../translations/de.json'; import * as en from '../translations/en.json'; import * as es from '../translations/es.json'; import * as nl from '../translations/nl.json'; -import * as pt-br from '../translations/pt-br.json'; +import * as pt_br from '../translations/pt-BR.json'; import { HomeAssistant } from '../types/homeassistant/types'; import { logMessage, lvlWarn } from './debug'; @@ -12,7 +12,7 @@ const languages: Record = { en, es, nl, - pt-br + 'pt-BR': pt_br, }; /** The fallback language if the user-defined language isn't defined */ @@ -52,7 +52,7 @@ let _localize: ((key: string) => string) | undefined = undefined; * It reads the user-defined language with a fall-back to English and returns a function to get strings from * language-files by keyword. * - * If the keyword is undefined, or on error, the keyword itself is returned. + * If the keyword is undefined, or on an error, the keyword itself is returned. * * @param {HomeAssistant} hass The Home Assistant object. */