Skip to content

Fix i18n initialization priority#651

Merged
hypest merged 11 commits intorelease/1.0from
issue/fix-i18n-initialization-priority
Feb 22, 2019
Merged

Fix i18n initialization priority#651
hypest merged 11 commits intorelease/1.0from
issue/fix-i18n-initialization-priority

Conversation

@koke
Copy link
Copy Markdown
Member

@koke koke commented Feb 22, 2019

Before this, the block titles were not being translated because the translation attempt happened before the locale data was set up.

This refactors the initialization process to ensure we setup localization before Gutenberg is imported

simulator screen shot - iphone xs - 2019-02-22 at 13 40 06

This was originally implemented as part of #643 but that one isn't ready to merge yet

To Test

  1. Switch your phone/simulator to another language
  2. Try to insert a block and verify the title is translated

koke and others added 3 commits February 22, 2019 13:36
Make sure the locale data is setup before importing anything, since block names
get translated on import
@koke koke added this to the v1.0 milestone Feb 22, 2019
@koke koke requested a review from Tug February 22, 2019 12:40
src/index.js Outdated
AppRegistry.registerComponent( 'gutenberg', () => RootComponent );
}

export function setupApp() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, let's call this bootstrapEditor or something. The "App" moniker starts to feel too vague, WDYT? :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed 👍

@koke koke changed the base branch from develop to release/1.0 February 22, 2019 13:40
Copy link
Copy Markdown
Contributor

@hypest hypest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Loving my i18n'd block names on the Inserter!

@hypest hypest merged commit 11c8c72 into release/1.0 Feb 22, 2019
@hypest hypest deleted the issue/fix-i18n-initialization-priority branch February 22, 2019 14:13
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.

3 participants