-
Notifications
You must be signed in to change notification settings - Fork 10
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
Localize common characters (attempt 2) #212
Conversation
14177cf
to
603a8a7
Compare
603a8a7
to
2e716c4
Compare
@@ -129,12 +158,25 @@ export const getLocalizeClass = (superclass = class {}) => class LocalizeClass e | |||
const possibleLanguages = this._generatePossibleLanguages(config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change 1: these lines were previously wrapped around an if (config.importFunc) {
but components that define their own static resources by manually implementing getLocalizeResources
were then not getting their resources filled in.
} | ||
return Promise.all(resourcesLoadedPromises); | ||
} | ||
|
||
static async _getLocalizeResources(langs, { importFunc, osloCollection, useBrowserLangs }) { | ||
|
||
if (importFunc === undefined) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change 2: the default implementation of getLocalizeResources
just calls this, but importFunc
can now be undefined
. So we short-circuit and return undefined
, but that's going to cause change 3 below...
🎉 This PR is included in version 3.21.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I had to quickly revert the first version of this as it broke a bunch of core unit tests. The reason for that is that the changes caused components wired up to use a
static
collection of resources (i.e. noimportFunc
) to stop working.I'll add comments to call out the changes I made to work around this.