-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Full Site Editing themes should support internationalization (i18n) and localization (l10n).
The process to extract and localize is summarized by this diagram.
Requirements
- To be able to use the Fizzie theme in the user's selected locale.
- To automatically extract and localize templates and template parts.
- Test with two additional languages:
- UK English - locale
en_GB
- bbboing's language
bb_BB
Proposed solution
- Create localized versions of the templates and template parts delivered by Fizzie.
- Use the automated tools developed in FSE - Can we internationalize .html files without requiring any special markup? oik-i18n#7
- Use a batch routine
t10n.bat
to automate the translation into UK English and bbboing. - Update Gutenberg and/or Fizzie to support loading of translated templates and template parts
- Test for UK English ( en_GB ) and bbboing ( bb_BB ).
Requirements on Gutenberg
- Gutenberg's template and template loading logic needs to be updated to take into account the user's locale.
- The translated files will be stored in subfolders of the
languages
folder, with one directory per supported locale. - If the directory isn't present the US English files are used.
Assumptions, scope, exclusions and caveats
- Templates and template parts are inherently static; they don't implement conditional / looping logic.
- Internationalization (i18n) of the templates and template parts is only necessary for certain strings which should not be translated.
- As such, localized versions can be created at build time, or whenever the translations are updated.
- Blocks used in templates and template parts may implement conditional / looping logic.
- These blocks are usually server side rendered using PHP.
- A theme's PHP code will be localized using
makepot
. - Any JavaScript blocks delivered by the theme will be localized using
makejson
. - The solution should support all locales and character sets currently supported by WordPress.
- The solution should support themes which are not delivered from wordpress.org
Limitations of the prototyped solution
t10n.bat
is currently dependent upon oik-batch's oik- The current routines are prototyped batch routines which echo debug information.
- Not all scenarios are yet catered for by the routines invoked by
t10n
. - The current solution doesn't merge
.pot
files into one file prior to translation. - But text strings used in PHP and template files and parts are not expected to be the same.
- So there shouldn't be too many duplicate strings to translate.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed