From dc6164011809f6d254ef82c95d6e2dae3030fc14 Mon Sep 17 00:00:00 2001 From: Samuel Stroschein <35429197+samuelstroschein@users.noreply.github.com> Date: Mon, 19 Jun 2023 19:15:45 +0200 Subject: [PATCH] chore: add inlang ide extension for i18n (#9599) * add: inlang for i18n * chore: format file * chore: re-add comments VSCode removed them for unknown reasons. --------- Co-authored-by: Peer Richelsen --- .vscode/extensions.json | 3 ++- apps/web/public/static/locales/en/common.json | 10 +++---- inlang.config.js | 27 +++++++++++++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 inlang.config.js diff --git a/.vscode/extensions.json b/.vscode/extensions.json index cae98d6257..74cae7dd16 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -8,6 +8,7 @@ "ban.spellright", // Spell check for docs "stripe.vscode-stripe", // stripe VSCode extension "Prisma.prisma", // syntax|format|completion for prisma - "rebornix.project-snippets" // Share useful snippets between collaborators + "rebornix.project-snippets", // Share useful snippets between collaborators + "inlang.vs-code-extension" // improved i18n DX ] } diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index 2a4aa130ee..7f20c7f609 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -1643,7 +1643,7 @@ "scheduler": "{Scheduler}", "no_workflows": "No workflows", "change_filter": "Change filter to see your personal and team workflows.", - "change_filter_common":"Change filter to see the results.", + "change_filter_common": "Change filter to see the results.", "no_results_for_filter": "No results for the filter", "recommended_next_steps": "Recommended next steps", "create_a_managed_event": "Create a managed event type", @@ -1834,8 +1834,8 @@ "open_dialog_with_element_click": "Open your Cal dialog when someone clicks an element.", "need_help_embedding": "Need help? See our guides for embedding Cal on Wix, Squarespace, or WordPress, check our common questions, or explore advanced embed options.", "book_my_cal": "Book my Cal", - "invite_as":"Invite as", - "form_updated_successfully":"Form updated successfully.", + "invite_as": "Invite as", + "form_updated_successfully": "Form updated successfully.", "disable_attendees_confirmation_emails": "Disable default confirmation emails for attendees", "disable_attendees_confirmation_emails_description": "At least one workflow is active on this event type that sends an email to the attendees when the event is booked.", "disable_host_confirmation_emails": "Disable default confirmation emails for host", @@ -1858,8 +1858,8 @@ "admin_username": "Administrator's username", "organization_name": "Organization name", "organization_url": "Organization URL", - "organization_verify_header" :"Verify your organization email", - "organization_verify_email_body":"Please use the code below to verify your email address to continue setting up your organization.", + "organization_verify_header": "Verify your organization email", + "organization_verify_email_body": "Please use the code below to verify your email address to continue setting up your organization.", "additional_url_parameters": "Additional URL parameters", "about_your_organization": "About your organization", "about_your_organization_description": "Organizations are shared environments where you can create multiple teams with shared members, event types, apps, workflows and more.", diff --git a/inlang.config.js b/inlang.config.js new file mode 100644 index 0000000000..18c502705f --- /dev/null +++ b/inlang.config.js @@ -0,0 +1,27 @@ + +// see https://inlang.com/ +export async function defineConfig(env) { + + const { default: i18nextPlugin } = await env.$import( + "https://cdn.jsdelivr.net/npm/@inlang/plugin-i18next@2/dist/index.js", + ) + + const { default: standardLintRules } = await env.$import( + "https://cdn.jsdelivr.net/npm/@inlang/plugin-standard-lint-rules@3/dist/index.js", + ) + + return { + referenceLanguage: "en", + plugins: [ + i18nextPlugin({ + pathPattern: "./apps/web/public/static/locales/{language}/common.json", + }), + standardLintRules({ + // deactivating identical pattern because of nested + // resources like "de-DE" and "de-AT" where "de-AT" + // contrains overwrites but the majority are identical patterns. + identicalPattern: "off" + }), + ], + } +} \ No newline at end of file