From 992c67a2b9f0efb257e915eb89eea9ef5154817b Mon Sep 17 00:00:00 2001 From: Nils Jacobsen <58360188+NilsJacobsen@users.noreply.github.com> Date: Thu, 14 Dec 2023 16:00:22 +0100 Subject: [PATCH] chore: add IDE extension for i18n handling (#1896) > let me know what needs to be changed in order to merge this # Description: DX upgrade with little i18n tool. - I added a [ide-extension](https://inlang.com/m/r7kp499g/app-inlang-ideExtension) config to `quivr`. This enables developers and contributors to extract, access and update translations in code using the existing json files under the hood. - **Opt-in:** With the config in place you can also use the [fink editor](https://inlang.com/m/tdozzpar/app-inlang-editor) to update product copy/translation with a no code UI. Here u see an example from my fork: https://inlang.com/editor/github.com/NilsJacobsen/quivr # What I added (opt-in) - A config file -> `settings.json` - Vscode recommendation so the contributors can use the extension ## Screenshots: IDE-Extension: ![image](https://github.com/StanGirard/quivr/assets/58360188/6f1217fe-692e-4aa2-942b-458cabf3bc2b) Editor: image --- .vscode/extensions.json | 13 +++++++------ project.inlang/settings.json | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 project.inlang/settings.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4d8e27c0c..bd3d2aeff 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,8 +1,9 @@ { - "recommendations": [ - "ms-pyright.pyright", - "dbaeumer.vscode-eslint", - "ms-python.vscode-pylance", - "ms-pyright.pyright" - ] + "recommendations": [ + "ms-pyright.pyright", + "dbaeumer.vscode-eslint", + "ms-python.vscode-pylance", + "ms-pyright.pyright", + "inlang.vs-code-extension" + ] } \ No newline at end of file diff --git a/project.inlang/settings.json b/project.inlang/settings.json new file mode 100644 index 000000000..e453a5a84 --- /dev/null +++ b/project.inlang/settings.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://inlang.com/schema/project-settings", + "sourceLanguageTag": "en", + "languageTags": [ + "en", "es", "fr", "pt-br", "ru", "zh-cn" + ], + "modules": [ + "https://cdn.jsdelivr.net/npm/@inlang/plugin-i18next@4/dist/index.js", + "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" + ], + "plugin.inlang.i18next": { + "pathPattern": { + "brain": "./frontend/public/locales/{languageTag}/brain.json", + "chat": "./frontend/public/locales/{languageTag}/chat.json", + "config": "./frontend/public/locales/{languageTag}/config.json", + "contact": "./frontend/public/locales/{languageTag}/contact.json", + "deleteOrUnsubscribeFormBrain": "./frontend/public/locales/{languageTag}/deleteOrUnsubscribeFormBrain.json", + "explore": "./frontend/public/locales/{languageTag}/explore.json", + "external_api_definition": "./frontend/public/locales/{languageTag}/external_api_definition.json", + "home": "./frontend/public/locales/{languageTag}/home.json", + "invitation": "./frontend/public/locales/{languageTag}/invitation.json", + "knowledge": "./frontend/public/locales/{languageTag}/knowledge.json", + "login": "./frontend/public/locales/{languageTag}/login.json", + "logout": "./frontend/public/locales/{languageTag}/logout.json", + "monetization": "./frontend/public/locales/{languageTag}/monetization.json", + "translation": "./frontend/public/locales/{languageTag}/translation.json", + "upload": "./frontend/public/locales/{languageTag}/upload.json", + "user": "./frontend/public/locales/{languageTag}/user.json" + } + } +} +