css i18n dos and don ts
play

CSS & i18n dos and donts when styling multilingual websites - PowerPoint PPT Presentation

CSS & i18n dos and donts when styling multilingual websites Gunnar Bittersmann brands4friends Road ahead 1. pitfalls when styling multilingual websites 2. whats new in CSS 3 3. whats not in CSS (yet?) Problem: word length Einige


  1. CSS & i18n dos and don’ts when styling multilingual websites Gunnar Bittersmann brands4friends

  2. Road ahead 1. pitfalls when styling multilingual websites 2. what’s new in CSS 3 3. what’s not in CSS (yet?)

  3. Problem: word length Einige Sprachen, wie z.B. nur eine geringe Breite zur Deutsch, Finnisch und Verfügung steht, bspw. Niederländisch, verwenden neben einem einzelne lange Wörter dafür, Formulareingabefeld, in was mehrere kürzere Wörter einer Reihe von Tabs oder in anderen Sprachen sind. Buttons, in schmalen Spalten. Der deutsche Text Aus „Input processing hingegen wird nicht features“ im Englischen wird automatisch umbrochen, „Eingabeverarbeitungsfunktionen“ was eine Herausforderung im Deutschen. Der englische für das Layout darstellen Text kann einfach auf zwei kann. Zeilen verteilt werden, wenn

  4. Solution: soft hyphens Einige Sprachen, wie z.B. verteilt werden, wenn nur Deutsch, Finnisch und eine geringe Breite zur Nieder-ländisch, verwenden Verfügung steht, bspw. einzelne lange Wörter dafür, neben einem Formular- was mehrere kürzere Wörter eingabe-feld, in einer Reihe in anderen Sprachen sind. von Tabs oder Buttons, in schmalen Spalten. Der Aus „Input processing deutsche Text hingegen wird features“ im Englischen wird nicht automatisch „Eingabe -verarbeitungs- umbrochen, was eine funktionen“ im Deutschen. Heraus-forderung für das Der englische Text kann Layout darstellen kann. einfach auf zwei Zeilen Setting break points is only feasible for own content, but often content is provided by other departments of the company (CMS) or is user-generated content .

  5. Solution: hyphenation Einige Sprachen, wie z.B. auf zwei Zeilen verteilt wer- Deutsch, Finnisch und Nie- den, wenn nur eine geringe derländisch, verwenden ein- Breite zur Verfügung steht, zelne lange Wörter dafür, bspw. neben einem Formu- was mehrere kürzere Wörter lareingabefeld, in einer Reihe in anderen Sprachen sind. von Tabs oder Buttons, in schmalen Spalten. Der deut- Aus „Input processing fea - sche Text hingegen wird tures“ im Englischen wird nicht automatisch umbro- „Eingabeverarbeitungsfunk - chen, was eine Herausforde- tionen“ im Deutschen. Der rung für das Layout darstel- englische Text kann einfach len kann. Text language must be labeled correctly, also of text fragments in different languages

  6. German version Nouns are spelled with a capital letter in German language; transformation to lowercase should not be applied to German text.

  7. Corrected German version Additional German language-specific rule overwrites transformation.

  8. German version Long words may cause short lines or large spaces. Note that there’s enough space between the menu and the sidenote on the right…

  9. Ukrainian version …as the menu needs more height the space between the menu and the sidenote shrinks…

  10. Russian version …as the menu needs even more height the contents overlap.

  11. Arabic version A horizontal scrollbar appears because of content for screenreaders that should be moved to the right out of the viewport on RTL pages.

  12. Arabic version border-bottom-right-radius should be resetted on RTL pages, box-shadow should be a mirrored version of that on LTR pages.

  13. Corrected Arabic version No horizontal scrollbar, border-radius and box-shadow properly set.

  14. Separate stylesheets? default.css: rtl.css: #wai-start #wai-start { { position: absolute; left: auto; left: -999px; right: -999px; width: 990px; } display: block; } Don’t rely on the order of stylesheets being included in HTML files; use more specific selectors

  15. Separate stylesheets? default.css: rtl.css: #wai-start [dir="rtl"] #wai-start { { position: absolute; left: auto; left: -999px; right: -999px; width: 990px; } display: block; } Having all rules in one stylesheet [dir="rtl"] #wai-start allows to overview corresponding { rules at one sight and makes it left: auto; less likely to forget something on right: -999px; later changes. }

  16. Dos and don’ts • Do not assume text to fit into a box, neither of certain width nor of certain height • Set soft hyphens in long compound words or use hyphenation • Use text effects that are appropriate for given language • Make sure you flip everything needed for websites in RTL scripts • Do not use multiple stylesheets for different languages/scripts/text directions, use one stylesheet (easier to maintain)

  17. New in CSS 3 text module • hyphens: auto • text-emphasis-style: sesame • text-justify: inter-ideograph || kashida • text-align: end might replace: #foo { text-align: right } [dir="rtl"] #foo { text-align: left }

  18. Styling by language body { font-family: Palatino, serif; } :script(Arab) :s cript(Arab) :lang(ar) , :lang(fa) , :lang(ps) , :lang(ur) , :lang(az-Arab) , :lang(uz-Arab) , :lang(bal), :lang(bqi), :lang(cja), :lang(glk), :lang(ug) { font-family: "Traditional Arabic", serif; } When content in another language written in Arabic script would later be added to a multilingual website, the stylesheet also needs to be changed. That’s not desired, hence it would be useful if there was a :script pseudoclass.

  19. Styling by script <html lang="ar" script="Arab" dir="rtl"> Type: language Subtag: ar Description: Arabic Added: 2005-10-16 Suppress-Script: Arab Scope: macrolanguage <html lang="az-Arab" script="Arab " dir="rtl "> The information about the script is already in the language tag: either in the script subtag or in the language subtag.

  20. Implementation  get language tag is undefined? y n has script y subtag? n look up script for language subtag found? n y use this value use default (Latn)

  21. Go raibh maith agat gunnar@bittersmann.de http://bittersmann.de

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend