-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
✨ [Story localization] Fetch strings for localization files if in experiment #37843
✨ [Story localization] Fetch strings for localization files if in experiment #37843
Conversation
Co-authored-by: Gabriel Majoulet <[email protected]>
…nto stringjson_inlined
…trings_controlled
…trings_controlled
Hey @gmajoulet, @newmuis! These files were changed:
|
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.
Fixed all comments, ready for another look @gmajoulet
@@ -1709,6 +1709,77 @@ describes.realWin( | |||
'Swipe up' | |||
); | |||
}); | |||
|
|||
describe('remote locales', () => { |
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.
The code overall doesn't seem to be extremely consistent but will try with this PR to keep all the changes using localization
.
.then((json) => | ||
localizationService.registerLocalizedStringBundle(languageCode, json) | ||
) | ||
.catch((err) => { |
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.
We shouldn't launch this till the AMP Cache does this fallback then, otherwise all docs with wrong lang
parameters would start failing.
@samouri we need OWNERS approval to add a prerenderSafe request that fetches a JSON from the AMP cache. Do you need any more details on this? Request will be to https://cdn.ampproject.org/v0/amp-story.en.json but |
Warning: disparity between this PR Percy build and its The Percy build for this PR was approved (either manually by a member of the AMP team, or automatically if there were no visual diffs). However, during a continuous integration step we generated another Percy build using the commit on the This is possibly an indication of an issue with this pull request, but could also be the result of flakiness. Please inspect the two builds < This PR's Percy build /
|
Create experiment
story-remote-localization
that disables the localization strings from the bundle and relies on the remote strings (from the CDN or localhost). The story first tries to find inline strings, and if not found, it will either install the strings bundled into amp-story or it will fetch from the CDN or localhost (depending onlocalDev
)Strings can be from:
Note: if the language is not one of the 80+ languages accepted, we will deal with that in the cache. Locally it will fail, but should not happen for any demo files.
cc @erwinmombay