How to set the Language (Lang) ?
About
In ComboStrap, you can define a language:
- for the application: The application Language (the default value for all pages)
- for a page: The Page Language
- for a component: The language attribute: How to set the language for a text
Value
The language is identified by a language identifier value known as the lang metadata.
It is a 2 letters code that follows the ISO 639-2 specification .
Example:
- en (English),
- fr (French)
- nl (Dutch)
- ar (Arabic). (See Right-to-left language support)
Usage
The language identifier is used:
- in the locale to localize the page for external social third party
- by the rendering engine to set the language and layout direction.
Direction
Each language has an intrinsic value that is known as the direction.
Direction Value | Direction Name | Description | Supported |
---|---|---|---|
LTR | left to right | You read the text from left to right (Example: English) | Yes |
RTL | right to left | You read the text from right to left (Example: Arabic) | Yes with the default bootstrap theme |
TTB | top-to-bottom | You read the text from top to bottom (Example: Chinese) | No |
RTL
We have created a page in arabic that has a language direction from right-to-left (rtl) See the demo page: صفحة مكتوبة باللغة العربية
As bootswatch does not support yet RTL languages, you need to set your Bootstrap version at minimal to 5 with the bootstrap theme.
Example with the version 5.01 - bootstrap: