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

Internationalization #22

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

Conversation

julienmalik
Copy link
Collaborator

Fixes #13

It generates index.$lang.html for all langs if you put something like :

multilingual: 
  - fr
  - es

in the root settings.yaml

The first defined language is special :

  • it is default one (if browser locale is not in available locale, this is the fallback)
  • it generates index.html, not index.$lang.html so that we always have an index.html (without the need to symlink/configure webserver/...)

To be multilingual, the gallery .yaml text sections then needs to be like :

title:
    fr: Salut
    es: Ola

but the monolingual case is still supported as before.
when generating a multilingual version, if a string is not translated (title: Hello) then it is used for all languages.

multi langages are supported only for title, subtitle and text keys.

On the html side, each page embeds a small javascript snippet which tries to redirect to the browser-locale version if it is available (and falls back to the default locale).

Didn't test static pages yet...
For the rest, it fulfills my needs for the moment so I'll stop here, waiting for comments.

@julienmalik
Copy link
Collaborator Author

cc @abeudin

@julienmalik
Copy link
Collaborator Author

doesn't work for menu (yet)

@julienmalik
Copy link
Collaborator Author

now it works for menus too with :

menu:
  - about:
      en : "About"
      fr : "A propos"
  - first_gallery:
      en : "My first gallery"
      fr : "Ma première gallerie"
  - http://twitter.com:
      en : "Twitter"
      fr : "Touitteur"

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.

1 participant