kolibri-design-system icon indicating copy to clipboard operation
kolibri-design-system copied to clipboard

Add better handling for buttons with long text in modals

Open jtamiace opened this issue 5 years ago • 5 comments

We do not have control over the length of text in buttons when they are being translated.

In the (rare?) case that the width of the button group in modals happens to exceed the width of the modal, the buttons should wrap, with the secondary action appearing below the primary action. They should still remain right-aligned.

Screen Shot 2020-07-08 at 11 28 50 AM

jtamiace avatar Jul 08 '20 18:07 jtamiace

we're about to add German so we might see a need for this appear soon

indirectlylit avatar Jul 13 '20 21:07 indirectlylit

German has already been merged, let me see if I can test this!

radinamatic avatar Jul 13 '20 21:07 radinamatic

@jtamiace Not a button, but you named it!

Win10 (all-languages)  Running  - Oracle VM VirtualBox_797

Khmer does seem to very long words (above is the Welcome to Kolibri modal) and not even spaced as in other languages, should the modal expand to accommodate?

radinamatic avatar Jul 14 '20 21:07 radinamatic

whoa

I had to google this... https://www.w3.org/International/articles/typography/linebreak.en

Looks like there are different "allowances" on line breaking for different scripts, whether it's at the end of the word or a syllable, or even a character. For Khmer specifically, unicode is one way to detect the end of a word?

In the past, the Unicode character U+200B ZERO WIDTH SPACE (ZWSP) was used to indicate word boundaries for these scripts, and some standard keyboards such as Khmer NIDA still generate ZWSP with the spacebar key, but recently major languages have line-breaking implementations at their disposal, which means ZWSP is not essential. Large-scale manual entry of ZWSP is also not very practical because the user cannot see the separator in most scenarios; this leads to problems with ZWSP being inserted in the wrong position, or multiple times. ZWSP may, however, be used to hand-craft and fix aspects of line-break behaviour.

It is also important to bear in mind that the scripts referred to here may be used to write languages other than those mentioned, in particular minority languages for which different dictionaries are needed. Since such dictionaries may not available in a given browser or other application, there is a tendency to use ZWSP in order to compensate.

I have little sense on what's in our range of capabilities to detect where line breaks are possible in other scripts.

I wonder if there are places where even if we extend to the full width of the page, it still wouldn't be enough for scripts that do not space their words...

jtamiace avatar Jul 14 '20 22:07 jtamiace

More examples of long buttons here: https://github.com/learningequality/kolibri/issues/7337

radinamatic avatar Jul 21 '20 23:07 radinamatic