-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Use blockLabel for BlockTitle component #23847
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1671622
Use blockLabel for BlockTitle component
noahtallen 1957e5f
Use dash as separator
noahtallen f484165
Check if label does not equal title, use colon
noahtallen 27aa6c0
Fix typo in comment
noahtallen 9cdf64c
Update BlockTitle unit tests
noahtallen 60cd2e5
Fix possible error when clientId did not exist
noahtallen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.
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.
I don't know if this was discussed but are we certain that "truncate" works well with internationalized strings? Should we rely on CSS truncate instead?
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.
It's aware of unicode chars, and it seems to handle them well in my (naïve) tests.
I've tried truncating a string with Japanese kanji and one with "complex" emoji, and in both cases the truncation happened as expected, with kanji and emojis being treated as single characters.
Note: that emoji string would be interpreted as this:
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.
I was more thinking about length. Different languages have different sizes for characters, so I was wondering if "pixels" is better than "character length" in these situations.
To clarify I don't have experience with this personally, so just wondering if there's precedent. Maybe @swissspidy knows.
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.
Hmm good question! I think I have to defer to @naokomc to get her view point as a Japanese speaker & locale manager to know whether truncating like this would work in that language.
I know that for word counting we have to differentiate between counting words and characters depending on the locale, but for truncating I am not sure..
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.
Quoting Text size in translation:
I tried to search for the widest Japanese character but couldn't find the answer. AFAIK there isn't a super-wide character in Japanese, they are more or less the same (although, different characters have different kerning if you are using non-proportional font).
Most Japanese character width itself is similar to uppercase "W", which is the widest character in the alphabet.
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.
It sounds like this truncate method should work ok then?