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

Amharic translation #6618

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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 lingui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module.exports = {
locales: [
'en',
'am',
'ca',
'de',
'en-GB',
Expand Down
1 change: 1 addition & 0 deletions src/components/hooks/dates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {useLanguagePrefs} from '#/state/preferences'
*/
const locales: Record<AppLanguage, Locale | undefined> = {
en: undefined,
am: undefined,
ca,
de,
['en-GB']: enGB,
Expand Down
2 changes: 2 additions & 0 deletions src/locale/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
switch (fixLegacyLanguageCode(lang)) {
case 'en':
return AppLanguage.en
case 'am':
return AppLanguage.am
case 'ca':
return AppLanguage.ca
case 'de':
Expand Down
4 changes: 4 additions & 0 deletions src/locale/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ import {useLanguagePrefs} from '#/state/preferences'
*/
export async function dynamicActivate(locale: AppLanguage) {
switch (locale) {
case AppLanguage.am: {
i18n.loadAndActivate({locale, messages: messagesAm})
break

This comment was marked as resolved.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks i will add those.

}
case AppLanguage.ca: {
i18n.loadAndActivate({locale, messages: messagesCa})
await Promise.all([
Expand Down
4 changes: 4 additions & 0 deletions src/locale/i18n.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export async function dynamicActivate(locale: AppLanguage) {
let mod: any

switch (locale) {
case AppLanguage.am: {
mod = await import(`./locales/am/messages`)
break
}
case AppLanguage.ca: {
mod = await import(`./locales/ca/messages`)
break
Expand Down
1 change: 1 addition & 0 deletions src/locale/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface Language {

export enum AppLanguage {
en = 'en',
am = 'am',
ca = 'ca',
de = 'de',
en_GB = 'en-GB',
Expand Down
Loading