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

Started svelte-i18n integration #567

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

papiche
Copy link

@papiche papiche commented Feb 9, 2025

To inform about "work in progress"
Added language selector using svelte-i18n

When used in code, it replaces fixed text with dynamic

For example, in ./src/app/MenuDesktop.svelte
Settings becomes {$_('page.home.settings.title', { default: 'Settings' })}

then sentence is displayed according to ./src/app/localization/lang/LANG.json

Before translating, this needs to get widely applied to populate "en.json" with all sentences.
Is it OK for you ? How would you like we get organized ?

@papiche papiche mentioned this pull request Feb 9, 2025
@staab
Copy link
Collaborator

staab commented Feb 9, 2025

This looks quite good, thank you! I will likely move the language selector somewhere less visible ultimately. My one question is whether it would make sense for commonly used terms (like "Relay") to get their own key? Probably premature abstraction, but I don't know what best practices are here.

@papiche
Copy link
Author

papiche commented Feb 10, 2025

would make sense for commonly used terms (like "Relay") to get their own key

As mean can change from context and synonyms can be used, it is better to make translation for each application routes like :

{
"page": {
  "home": {
    "feeds": "Feeds",
    "relays": "Relay",
    ... },
  "notes": { ...
    },
  "settings": { ...
}

I must still explore and discover Coracle to be able to make a complete i18n json
To get help, i'm trying to get in touch with @Cristol-7 (#561) ...

Let's see how it goes ;)

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

Successfully merging this pull request may close these issues.

2 participants