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

Localization #216

Open
AxelSkye opened this issue Jul 25, 2024 · 9 comments
Open

Localization #216

AxelSkye opened this issue Jul 25, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@AxelSkye
Copy link

It would be great to have the website and documentation in different languages.

@GabsEdits GabsEdits added the enhancement New feature or request label Jul 29, 2024
@kelvin-hey
Copy link
Contributor

I would like to work on the website localization task. Is that possible?

@mirkobrombin
Copy link
Member

Sure, we do not have a localization system, feel free to propose a solution. Better if you write your idea before coding it

@kelvin-hey
Copy link
Contributor

I tested it in the local environment using the vue-i18n plugin, which allows for dynamic translations in Vue.js applications.

Plugin: https://kazupon.github.io/vue-i18n/

VanillaOs_Localization.mp4

Explanation

The original text for the pages is stored in a JSON file, and from this file, translations can be generated for different languages.

English

Localization Vanilla Os en-us

Portuguese

Localization Vanilla Os pt-br

To implement the translations, simply replace the text inside each tag with $t('key').

Localization Vanilla Os text replace

The $t function is used to access the translations. For example, {{ $t('welcomeMessage') }} will display "is your next Operating System." in English or "é o seu novo Sistema Operacional." in Portuguese, depending on the selected language.

@mirkobrombin
Copy link
Member

@kbdharun what do you think about this? In terms of Weblate.

@GabsEdits
Copy link
Member

GabsEdits commented Jan 2, 2025

vue-i18n

vue-i18n is pretty good, used it on a few projects, I'll give a + for it.

Edit: It seems vue-i18n v8 has reached end of life. Check out v9: https://vue-i18n.intlify.dev/

@GabsEdits
Copy link
Member

@kbdharun what do you think about this? In terms of Weblate.

Weblate supports the json format, which can be intigrated with vue-i18n 9: https://docs.weblate.org/en/latest/formats/json.html

@kbdharun
Copy link
Member

kbdharun commented Jan 2, 2025

@kbdharun what do you think about this? In terms of Weblate.

Website translations (for various languages) are supported by Weblate and it's doable since we have a lot of strings left in our libre plan limit.

image

We previously didn't implement it since our Weblate had a lot of strings that used up the limit, from multiple languages added from an add-on which ensured that all components had a translation file for added languages (we have since removed the add-on and have removed empty translation files).

My only concern is that translations for the website component could eventually add up to the overall libre plan string limit, so I would suggest making only the non-blog post strings translatable (and keeping the blog posts in English).

@kelvin-hey
Copy link
Contributor

From what I understand, the necessary steps would be as follows:

  1. Create the project/component on Weblate for the website.

In this case, both the creation of the project on Weblate and the integration with the GitHub repository would be done by the project administrator, correct?

  1. Generate the JSON file with the mapped strings from the pages, using the vue-i18n plugin in the project.

Here, I would be responsible for finishing the mapping of the page strings, except for the blog pages.

  1. Upload the translation files in JSON format to Weblate.

  2. Translate the strings into other languages on Weblate.

So for now, I should finish mapping the strings with i18n and, once completed, share the changes for review?

@mirkobrombin
Copy link
Member

@kbdharun what do you think about this? In terms of Weblate.

Website translations (for various languages) are supported by Weblate and it's doable since we have a lot of strings left in our libre plan limit.

image

We previously didn't implement it since our Weblate had a lot of strings that used up the limit, from multiple languages added from an add-on which ensured that all components had a translation file for added languages (we have since removed the add-on and have removed empty translation files).

My only concern is that translations for the website component could eventually add up to the overall libre plan string limit, so I would suggest making only the non-blog post strings translatable (and keeping the blog posts in English).

Agree with this and with @GabsEdits concerns about the EOL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants