Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking β€œSign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Russian localization for the application #234

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/i18n/i18n-types.ts
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ export type BaseLocale = 'en'

export type Locales =
| 'en'
| 'ru'

export type Translation = RootTranslation

1 change: 1 addition & 0 deletions src/i18n/i18n-util.async.ts
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import { loadedFormatters, loadedLocales, locales } from './i18n-util'

const localeTranslationLoaders = {
en: () => import('./en'),
ru: () => import('./ru'),
}

const updateDictionary = (locale: Locales, dictionary: Partial<Translations>): Translations =>
2 changes: 2 additions & 0 deletions src/i18n/i18n-util.sync.ts
Original file line number Diff line number Diff line change
@@ -6,9 +6,11 @@ import type { Locales, Translations } from './i18n-types'
import { loadedFormatters, loadedLocales, locales } from './i18n-util'

import en from './en'
import ru from './ru'

const localeTranslations = {
en,
ru,
}

export const loadLocale = (locale: Locales): void => {
3 changes: 2 additions & 1 deletion src/i18n/i18n-util.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,8 @@ import type { Formatters, Locales, Translations, TranslationFunctions } from './
export const baseLocale: Locales = 'en'

export const locales: Locales[] = [
'en'
'en',
'ru'
]

export const isLocale = (locale: string): locale is Locales => locales.includes(locale as Locales)
Loading