-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀♻️ Normalize how locale strings are rendered in
amp-story
(#36677)
All callsites now use `localize(element, key)`. This attempts zero changes in functionality. This function compresses better than the alternatives, which we're able remove as well: - `getLocalizationService(...).getLocalizedString(...)`. Some callsites check for existence of the service even though it's always present, and sometimes they'd store it in a private. `localize()` is briefer. - On `simple-template`, we remove awkward fields: `unlocalizedString` and `localizedStringId` use `children`, and `localizedLabelId` is moved to an `aria-label` in `attrs`. This allows us to simplify the `simple-template` implementation, and reformats templates so that they'll be more easily converted to JSX in the future. Together, these changes reduce the module build by 0.15K-0.30K
- Loading branch information
1 parent
a4dcc00
commit 50e6ed2
Showing
18 changed files
with
312 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.