This repository was archived by the owner on Nov 21, 2019. It is now read-only.
[WIP] Use CLDR data for list separators#45
Open
thewilkybarkid wants to merge 8 commits intolibero:masterfrom
Open
[WIP] Use CLDR data for list separators#45thewilkybarkid wants to merge 8 commits intolibero:masterfrom
thewilkybarkid wants to merge 8 commits intolibero:masterfrom
Conversation
|
|
||
| &:lang(ja):after { | ||
| content: "、"; | ||
| @each $locale, $separator in $list-separators { |
Contributor
There was a problem hiding this comment.
Could do with a comment describing where $list-separators comes from.
gulpfile.babel.js
Outdated
|
|
||
| const cleanSassLocaleData = () => del([config.files.src.sassLocales]); | ||
|
|
||
| const generateSassLocaleData = () => { |
Contributor
There was a problem hiding this comment.
I wonder if it's worth extracting (at least some of) this into a module. There's quite a bit going on here, and that would make it more testable.
thewilkybarkid
commented
Jan 24, 2019
source/css/sass/mixins/_lists.scss
Outdated
| @include nospace("inline-start"); | ||
| } | ||
|
|
||
| @mixin inline-list-item() { |
Contributor
Author
There was a problem hiding this comment.
Did wonder about including this in inline-list() using &__item.
Contributor
There was a problem hiding this comment.
I'n not too keen on partial selectors, because they can get missed during refactoring.
Contributor
Author
|
Can add final ellipsis characters pattern-library/source/css/sass/mixins/_sizes.scss Lines 58 to 60 in 3b60cad |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The result of this initial commit is what we want: locale data coming from CLDR where possible. The JS will need tidying up but works.
Picking out the right data is tricky. Locale codes in CLDR are similar to BCP 47 (used by HTML), but a bit different. Inheritance being one: for example
en_DE -> en_150 -> en_001 -> en -> rootin CLDR buten-DE -> enin BCP 47, andsr_Latn -> rootin CLDR butsr-Latn -> srin BCP 47 (CLDR has set rules, BCP 47 just goes up a level).And then there's differences like:
zh-cmn-Hans-CN(Chinese, Mandarin, Simplified script, as used in China)cmn-Hans-CN(Mandarin Chinese, Simplified script, as used in China)zh-yue-HK(Chinese, Cantonese, as used in Hong Kong SAR)yue-HK(Cantonese Chinese, as used in Hong Kong SAR)zh-Hans-CN(Chinese written using the Simplified script as used in mainland China)So, this uses the CLDR data to get a list of locales, produces a map of parents based on the BCP 47 rule, then uses the CLDR data to work out the right value for every level. It then works out what's superfluous, which is most of it (eg
en-GBhas the same value asenso isn't needed, butenis the same as the default value so also isn't).