Language Selection and Determination

Language Selection and Determination

hotelRSV is translated into the following languages:
-  English
-  Español
-  Italiano
-  Português
-  Français
-  Deutsch
-  русский (Russian)
-  日本人 (Japanese)
-  (Arabic) العربية
-  中国 (Chinese – Zhōngwén )
-  한국어/조선말 (Korean)
-  עִבְרִית‎ (Hebrew) (coming soon)
Notes
hotelRSV will show the user the correct language automatically based on the language of the browser. Therefore, it is not necessary to perform any additional work by the webmaster.

Programmatic Language Determination (Optional)


It is possible to select at a global level (for all Action items on the page) and at a singular level (for each Booking Button or Action Item). The language scheme works in cascade, determining the language of the application according to the following scheme:
-Singular Level First take the language in the hotelrsv-lang="XX" attribute of the action item (booking button), if it is not declared, then go to the global level.
-Global Level Script Language in the <head> or <footer> (depending on where you have localized the hotelRSV library script): <script> var hotelrsv_lang = "browser_lang";</script>.
This means that the application will first take into account the language determined at the singular level and in case it is not declared, it will take the global one by default. In this way, the same page can have action elements in different languages, allowing to programmatically choose the desired language.

Declaring the Global Variable

  1. <!-- HOTELRSV Language Selection -->
  2. <script> var hotelrsv_lang = "browser_lang";</script> <!-- OPTIONAL -->
  3. <!-- END HOTELRSV Language Selection -->
Notes
The var hotelrsv_lang variable at the level is not mandatory, however it is the one that allows you to determine globally (for that page) the preferred language of the Web App. If the variable is not declared hotelRSV will automatically take the browser language, if hotelRSV is not available in the browser language, hotelRSV will run in English.

Valid Language Code Values



Code
Description
Global Example: <head> or <footer>
Singular Level Example for Action Items
browser_lang
It will take the default language of the browser.
Spanish if it is Spanish, English for all other languages.
Info
<script var hotelrsv_lang = "browser_lang";>
Info
<button class="rsv-app-launcher" data-hotelrsv-lang="browser_lang">
or
Info
<button class="rsv-app-launcher">
Since without declaring the attribute data-hotelrsv-lang it will take the default attribute of the script globally.
en, es, it, de, pt, fr, ru, jp, ar, zh, ko
Use two-character ISO 3166-2 language codes.
Info
<script var hotelrsv_lang = "de";>
Info
<a class="rsv-app-launcher" data-hotelrsv-lang="de">

It is possible to create several action buttons with different languages within the same page (indicating them with the attribute data-hotelrsv-lang). However, only one language can be specified globally (remember that each page must have its own set of instructions).