Skip to content

Commit

Permalink
Merge pull request #300 from intuitem/i18n/paraglide-setup-arabic
Browse files Browse the repository at this point in the history
i18n: Set up arabic localization with Fink 🐦
  • Loading branch information
ab-smith authored Apr 20, 2024
2 parents 12e6bf2 + 2d059dc commit 679c699
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 19 deletions.
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;
}

0 comments on commit 679c699

Please sign in to comment.