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

[RFC] Translations and Internationalization #110

Closed
batisteo opened this issue Aug 17, 2017 · 4 comments
Closed

[RFC] Translations and Internationalization #110

batisteo opened this issue Aug 17, 2017 · 4 comments

Comments

@batisteo
Copy link
Contributor

batisteo commented Aug 17, 2017

Summary

This feature aims to make Gutenberg support multilingual sites

Motivation

Why are we doing this? What use cases does it support? What is the expected outcome?

Guide-level explanation

Overview

URLs

Configuration

language_code is now understood as the default language

languages is an array of language codes as key, and the name in that language as value:

[languages]
en = "English"
fr = "Français"
pt_BR = "Português (BR)"
eo = "Esperanto"

The order matters: it could be rendered in the language selector widget.

The default language has to appear in the array, but don’t have to be the first language (even it might be more intuitive to be).

Content

File organization

The content files have to have the same name for multiple languages.
The language is defined in the extension prefix: {name}.{language_code}.{extension}

The language code can be omitted for the default language.

content
├── _index.md (or _index.en.md)
├── _index.fr.md
├── about.en.md
├── about.fr.md
└── some_section
    ├── _index.en.md
    └── _index.fr.md

Slug

I18n

Context

  • lang: the current language code, always available, even for default language;

  • language: the current language. language.code is equivalent to lang;

  • config.languages: used for building the language selector by iterating the key / value pairs;

  • section.languages listing the available translations for the current section;

  • page.languages listing the available translations for the current page;

Misc

Language selector

RSS

Reference-level explanation

This is the technical portion of the RFC. Explain the design in sufficient detail that:

  • Its interaction with other features is clear.
  • It is reasonably clear how the feature would be implemented.
  • Corner cases are dissected by example.

The section should return to the examples given in the previous section, and explain more fully how the detailed proposal makes those examples work.

Drawbacks

Why should we not do this?

Rationale and Alternatives

  • Why is this design the best in the space of possible designs?
  • What other designs have been considered and what is the rationale for not choosing them?
  • What is the impact of not doing this?

Unresolved questions

  • What parts of the design do you expect to resolve through the RFC process before this gets merged?
  • What parts of the design do you expect to resolve through the implementation of this feature before stabilization?
  • What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC?
@batisteo
Copy link
Contributor Author

[We might want to use the wiki for RFCs]

@Keats
Copy link
Collaborator

Keats commented Aug 17, 2017 via email

@Keats
Copy link
Collaborator

Keats commented Aug 17, 2017

By the way for the languages map, I see more something like

default_language = "en"

[languages]

[languages.en]
title = "My blog"
description = "Hello world"

[languages.fr]
title = "Mon blog"

Which means renaming language_code to default_language as it is only used for i18n and is more explicit that way. Using maps like in the example above will give us the basic i18n needed for the template

@Keats
Copy link
Collaborator

Keats commented Aug 21, 2017

Closing in favour of #111

@Keats Keats closed this as completed Aug 21, 2017
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

No branches or pull requests

2 participants