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

Unify i18n logic in the various Craft apps #32375

Merged
merged 6 commits into from Dec 19, 2019
Merged

Unify i18n logic in the various Craft apps #32375

merged 6 commits into from Dec 19, 2019

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented Dec 10, 2019

Description

Follow-up to #32136

Right now, all the Craft apps share the same i18n file, but each one also references that file independently and reimplements a bunch of shared logic around i18n. This change brings all shared i18n code up one level to be used by all Craft apps equally.

Links

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@Hamms Hamms marked this pull request as ready for review December 10, 2019 22:41
@Hamms Hamms changed the base branch from staging-next to staging December 17, 2019 20:45
@joshlory
Copy link
Contributor

To make sure I understand — this de-dups the localization across the four Craft variants, and merges all the strings into one file? Did you programmatically build the superset or create it by hand?

@@ -0,0 +1,30 @@
import {assert} from '../../util/deprecatedChai';
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason not to use reconfiguredChai?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no idea! I was just copying what's in the existing craftTest

@Hamms
Copy link
Contributor Author

Hamms commented Dec 19, 2019

this de-dups the localization across the four Craft variants, and merges all the strings into one file?

precisely!

Did you programmatically build the superset or create it by hand?

Bit of both; I copied all objects into one, sorted the keys by name, and deleted duplicates.

@joshlory
Copy link
Contributor

Ah, cool. Looks like the end result was exactly the same as what the "agent" version had:

image

Copy link
Member

@davidsbailey davidsbailey left a comment

Choose a reason for hiding this comment

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

LGTM! Sorry for missing this the first time around.

Ah, cool. Looks like the end result was exactly the same as what the "agent" version had:

image

This seems strange at first, but can probably be explained if each subsequent minecraft copied the previous one's locale file and then added to it.

@Hamms Hamms merged commit a623ce1 into staging Dec 19, 2019
@Hamms Hamms deleted the unify-mc-block-i18n branch December 19, 2019 23:47
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.

None yet

3 participants