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

i18n: Set up arabic localization with Fink 🐦 #300

Merged
merged 3 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions frontend/messages/ar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://inlang.com/schema/inlang-message-format",
"type": "نوع"
}

1 change: 1 addition & 0 deletions frontend/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "https://inlang.com/schema/inlang-message-format",
"french": "French",
"english": "English",
"arabic": "Arabic",
"addThreat": "Add threat",
"addReferenceControl": "Add reference control",
"addAppliedControl": "Add applied control",
Expand Down
1 change: 1 addition & 0 deletions frontend/messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "https://inlang.com/schema/inlang-message-format",
"french": "Français",
"english": "Anglais",
"arabic": "Arabe",
"addThreat": "Ajouter une menace",
"addReferenceControl": "Ajouter une mesure de référence",
"addAppliedControl": "Ajouter une mesure appliquée",
Expand Down
36 changes: 20 additions & 16 deletions frontend/project.inlang/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
{
"$schema": "https://inlang.com/schema/project-settings",
"sourceLanguageTag": "en",
"languageTags": ["en", "fr"],
"modules": [
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-valid-js-identifier@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@latest/dist/index.js"
],
"plugin.inlang.messageFormat": {
"pathPattern": "./messages/{languageTag}.json"
}
}
"$schema": "https://inlang.com/schema/project-settings",
"sourceLanguageTag": "en",
"languageTags": [
"en",
"ar",
"fr"
],
"modules": [
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-valid-js-identifier@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@latest/dist/index.js"
],
"plugin.inlang.messageFormat": {
"pathPattern": "./messages/{languageTag}.json"
}
}
3 changes: 2 additions & 1 deletion frontend/src/lib/components/SideBar/SideBarFooter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

const language: any = {
french: m.french(),
english: m.english()
english: m.english(),
arabic: m.arabic()
};

const modalStore = getModalStore();
Expand Down
13 changes: 11 additions & 2 deletions frontend/src/lib/utils/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export const LOCALE_MAP = {
fr: {
name: 'french',
flag: '🇫🇷'
},
ar: {
name: 'arabic',
flag: '🇸🇦'
}
};

Expand All @@ -29,6 +33,7 @@ export function localItems(languageTag: string): LocalItems {
const LOCAL_ITEMS = {
french: m.french({ languageTag: languageTag }),
english: m.english({ languageTag: languageTag }),
arabic: m.arabic({ languageTag: languageTag }),
home: m.home({ languageTag: languageTag }),
edit: m.edit({ languageTag: languageTag }),
overview: m.overview({ languageTag: languageTag }),
Expand Down Expand Up @@ -314,8 +319,12 @@ export function localItems(languageTag: string): LocalItems {
libraryImportError: m.libraryImportError({ languageTag: languageTag }),
libraryAlreadyExistsError: m.libraryAlreadyImportedError({ languageTag: languageTag }),
invalidLibraryFileError: m.invalidLibraryFileError({ languageTag: languageTag }),
attemptToDeleteOnlyAdminAccountError: m.attemptToDeleteOnlyAdminAccountError({ languageTag: languageTag }),
attemptToRemoveOnlyAdminUserGroup: m.attemptToRemoveOnlyAdminUserGroup({ languageTag: languageTag })
attemptToDeleteOnlyAdminAccountError: m.attemptToDeleteOnlyAdminAccountError({
languageTag: languageTag
}),
attemptToRemoveOnlyAdminUserGroup: m.attemptToRemoveOnlyAdminUserGroup({
languageTag: languageTag
})
};
return LOCAL_ITEMS;
}
Loading