diff --git a/content/developer/howtos/website_themes/translations.rst b/content/developer/howtos/website_themes/translations.rst index ae8d61b7f..19e87b396 100644 --- a/content/developer/howtos/website_themes/translations.rst +++ b/content/developer/howtos/website_themes/translations.rst @@ -10,6 +10,8 @@ In this chapter, you will learn how to: - Import and export translations. - Integrate translations to a module. +.. _website_themes/translations/frontend: + Frontend ======== @@ -25,6 +27,97 @@ manually is highlighted in yellow. :alt: Translate button :width: 570 +However, you have to understand what's happening under the hood when you translate something +through the Website Builder. + +.. _website_themes/translations/frontend/default_pages: + +Default pages +------------- + +Odoo creates a base view once the Website is installed. If you edit the page with the Builder, a +duplicated view will be created and all your modifications will be saved into this one (and your +translations also). The only exception concerns the homepage (by default, Odoo creates a base and +duplicated view even before you've edited anything). + +.. image:: translations/translations-page.png + :alt: Translations dupliclated page + +We recommend to be very careful about the order in which you will carry out translations or +modifications in the source language, either if you created the page through the Website Builder or +through the source code with a record. Note that every single modification of the source language +(`Edit master`) will break the link between the source language and the existing translations. In +other words, you'll have to re-create the translations if you edit the source language. + +.. _website_themes/translations/frontend/strings: + +Translatable strings +-------------------- + +.. _website_themes/translations/frontend/strings/t-att: + +t-att- / t-attf- +~~~~~~~~~~~~~~~~ + +If you want to set a translatable string, use preferably `t-attf-` instead of `t-att-` whenever +possible. + +**Example** + +To write “Hello *username*”, you can do it in the following way: + +.. code-block:: xml + +
+ +.. warning:: + + You could also achieve the same result with an `t-att-title` like the example below. However, + the result won't be considered natively as a translatable string: + + .. code-block:: xml + + + +.. _website_themes/translations/frontend/strings/exception: + +Exception: t-value / t-valuef +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`t-value` and `t-valuef` are a bit different. None of them are explicitly translatable, so you +could write something like this: + +.. code-block:: xml + +