Skip to content

Commit

Permalink
feat brazilian portuguese translation
Browse files Browse the repository at this point in the history
  • Loading branch information
fredguth committed Dec 30, 2023
1 parent 4572bba commit bca9a66
Show file tree
Hide file tree
Showing 3 changed files with 430 additions and 1 deletion.
2 changes: 2 additions & 0 deletions odd-platform-ui/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export const LANGUAGES_MAP = {
fr: 'French',
ua: 'Ukrainian',
hy: 'Armenian',
br: 'Brazilian Portuguese',
} as const;

export const LANG_TO_COUNTRY_CODE_MAP = {
Expand All @@ -157,6 +158,7 @@ export const LANG_TO_COUNTRY_CODE_MAP = {
fr: 'fr',
ua: 'ua',
hy: 'am',
br: 'br',
} as const;

// regexp
Expand Down
4 changes: 3 additions & 1 deletion odd-platform-ui/src/locales/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ch from './translations/ch.json';
import fr from './translations/fr.json';
import ua from './translations/ua.json';
import hy from './translations/hy.json';
import br from './translations/br.json';

const resources = {
en: { translation: en },
Expand All @@ -14,6 +15,7 @@ const resources = {
fr: { translation: fr },
ua: { translation: ua },
hy: { translation: hy },
br: { translation: br },
};

const languages = Object.keys(resources);
Expand All @@ -27,7 +29,7 @@ const savedLanguage = languages.includes(storedLanguage)
i18n.use(initReactI18next).init({
resources,
lng: savedLanguage,
fallbackLng: ['en', 'es', 'ch', 'fr', 'ua', 'hy'],
fallbackLng: ['en', 'es', 'br', 'ch', 'fr', 'ua', 'hy'],
});

export default i18n;
Loading

0 comments on commit bca9a66

Please sign in to comment.