sites icon indicating copy to clipboard operation
sites copied to clipboard

Sites localization

Open AlexxNB opened this issue 4 years ago • 2 comments

Since we have a single repo for all sites, finally we can add a localization, aren't we?

What should be translatable:

  1. Docs in corresponding repos. (right now we have documentation for Kit and Svelte fully translated to russian)
  2. Text content in components (also in packages directory).

Any ideas how to bring this to live?

AlexxNB avatar Dec 20 '21 08:12 AlexxNB

On the code side, we'd have to setup i18n support for SvelteKit. I think people like svelte-intl-precompile as one option for handling the in-app content. But a lot of our content is served via the API, so we'd also have to setup i18n support there and I'm not quite sure how to do that.

Even if we handle everything on the tech side, there's a question of how to handle process. If a contributor adds or edits docs, how would people who want to translate docs know that? Would they just check that directory in the GitHub repo for commits every so often?

benmccann avatar Dec 20 '21 13:12 benmccann

Looks like changes in API wont be huge. Hope @pngwn may say more...

I suppose that there will be directories like en,ru and etc in documentation in kit and svelte repos. Each language will be a copy of the en directory structure. English should be a fallback for any language, when requested localized md-file is missed. This should be done on API level, I think.

In app translation could be done with any i18n tool. Also we may need different assets for languages. For example on russian site we used patched Overpass font, because there no russian glyps in original font used on svelte sites.

To keep russian translation actual we use the Github action which tracks commits in docs subdirectory of svelte site and post them as issue in our repo. But I suggest another way. Let translated page shows notification "This page is outdated, see english page for actual information" in case when last commit in english file was made after than last commit in translated file. Anybody who see this notification can edit page to actualize translation. I think commit dates also may be acquired when building DB for API.

AlexxNB avatar Dec 20 '21 18:12 AlexxNB