Right-To-Left (RTL) Support
This feature is supported in version 202506.1.0 and later.
Overview
This document outlines how to enable and support Right-To-Left (RTL) languages in your application to ensure correct layout, proper text alignment, and an optimal user experience for RTL language speakers.
Platforms: Tizen and WebOS
Supported TVs: Samsung and WebOS
What is RTL?
RTL (Right-To-Left) refers to languages that are written and read from the right side of the page or screen to the left. Refer to the table below for more information on common RTL languages.
| Language | Example Script |
|---|---|
| Arabic | العربية |
| Hebrew | עברית |
| Persian | فارسی |
| Urdu | اردو |
Enable RTL support
OneTrust.isRTLayout()
Returns a boolean indicating whether the current language is right-to-left (RTL).
| Boolean | Action |
|---|---|
true | Call OneTrust.setRemoteKeys() with the RTL key codes. |
false | Call OneTrust.setRemoteKeys() with the regular (LTR) key codes. |
Relevant OneTrust SDK Key Codes
RTL key codes
| Key Code | Action |
|---|---|
| ArrowRight | LEFT |
| ArrowLeft | RIGHT |
LTR key codes
| Key Code | Action |
|---|---|
| ArrowRight | RIGHT |
| ArrowLeft | LEFT |
Sample Code
const tvRtlRemoteKeys = {
ArrowUp: 'UP',
ArrowDown: 'DOWN',
ArrowRight: 'LEFT',
ArrowLeft: 'RIGHT',
Enter: 'OK',
Backspace: 'BACK',
38: 'UP',
40: 'DOWN',
39: 'LEFT',
37: 'RIGHT',
13: 'OK',
8: 'BACK',
10009: 'BACK',
461: 'BACK'
};
const tvRemoteKeys = {
ArrowUp: 'UP',
ArrowDown: 'DOWN',
ArrowRight: 'RIGHT',
ArrowLeft: 'LEFT',
Enter: 'OK',
Backspace: 'BACK',
Escape: 'BACK',
38: 'UP',
40: 'DOWN',
39: 'RIGHT',
37: 'LEFT',
13: 'OK',
8: 'BACK',
10009: 'BACK',
461: 'BACK'
};
function setupUI() {
const rtl = OneTrust.isRTLayout();
OneTrust.setRemoteKeys(rtl ? tvRtlRemoteKeys : tvRemoteKeys);
OneTrust.setupUI('self');
}