bobbingwide / fizzie

Fizzie theme - a Full Site Editing theme using Gutenberg blocks
9 stars 1 forks source link

Create localized versions of the templates and template parts #46

Open bobbingwide opened 3 years ago

bobbingwide commented 3 years ago

Full Site Editing themes should support internationalization (i18n) and localization (l10n).

The process to extract and localize is summarized by this diagram.

screenshot

Requirements

  1. UK English - locale en_GB
  2. bbboing's language bb_BB

Proposed solution

Requirements on Gutenberg

Assumptions, scope, exclusions and caveats

Limitations of the prototyped solution

bobbingwide commented 3 years ago

I've created a new version of the extraction and localization routines in bobbingwide/oik-i18n/issues/9 which now supports extraction translation and localization of rich text strings. These changes need to be tested in Fizzie before the Gutenberg proposal is updated.

bobbingwide commented 1 year ago

t10n needs to be updated to work with a different directory structure.

bobbingwide commented 1 year ago

Having updated t10n I was able to re-activate the template part override to demonstrate the loading of localized template parts on the front end.

I can't remember whether or not I managed to achieve loading of localized templates but I've found a note that suggests I didn't bother. It says

We can implement a local solution for the Fizzie theme that doesn't require changes to Gutenberg with the following assumptions.

  • The block-template files only contain non-translatable content

https://github.com/bobbingwide/oik-i18n/issues/7#issuecomment-739234264

bobbingwide commented 1 year ago

The current logic for overriding template parts doesn't work for template parts that are created in the Site Editor or Post Editor. On the front end it displays a message saying that the language file couldn't be found. The logic doesn't try to locate the post for the template part.