diff --git a/tutorials/i18n/img/import_csv.webp b/tutorials/i18n/img/import_csv.webp index ce802d945..625e9d265 100644 Binary files a/tutorials/i18n/img/import_csv.webp and b/tutorials/i18n/img/import_csv.webp differ diff --git a/tutorials/i18n/img/locale_editor_preview.webp b/tutorials/i18n/img/locale_editor_preview.webp index 7aa0f39de..39cbd01ed 100644 Binary files a/tutorials/i18n/img/locale_editor_preview.webp and b/tutorials/i18n/img/locale_editor_preview.webp differ diff --git a/tutorials/i18n/img/locale_test.webp b/tutorials/i18n/img/locale_test.webp index 67ebae033..a6c174a27 100644 Binary files a/tutorials/i18n/img/locale_test.webp and b/tutorials/i18n/img/locale_test.webp differ diff --git a/tutorials/i18n/img/localization_dialog.png b/tutorials/i18n/img/localization_dialog.png deleted file mode 100644 index 968b8fe6a..000000000 Binary files a/tutorials/i18n/img/localization_dialog.png and /dev/null differ diff --git a/tutorials/i18n/img/localization_dialog.webp b/tutorials/i18n/img/localization_dialog.webp new file mode 100644 index 000000000..09671ace6 Binary files /dev/null and b/tutorials/i18n/img/localization_dialog.webp differ diff --git a/tutorials/i18n/img/localization_remaps.png b/tutorials/i18n/img/localization_remaps.png deleted file mode 100644 index e15ba3334..000000000 Binary files a/tutorials/i18n/img/localization_remaps.png and /dev/null differ diff --git a/tutorials/i18n/img/localization_remaps.webp b/tutorials/i18n/img/localization_remaps.webp new file mode 100644 index 000000000..6655a3df0 Binary files /dev/null and b/tutorials/i18n/img/localization_remaps.webp differ diff --git a/tutorials/i18n/img/localization_using_gettext_pot_generation.webp b/tutorials/i18n/img/localization_using_gettext_pot_generation.webp index 1097086f6..7543f9b24 100644 Binary files a/tutorials/i18n/img/localization_using_gettext_pot_generation.webp and b/tutorials/i18n/img/localization_using_gettext_pot_generation.webp differ diff --git a/tutorials/i18n/img/localized_name.webp b/tutorials/i18n/img/localized_name.webp index 485e4ae5d..b6ea50560 100644 Binary files a/tutorials/i18n/img/localized_name.webp and b/tutorials/i18n/img/localized_name.webp differ diff --git a/tutorials/i18n/img/pseudolocalization_settings.webp b/tutorials/i18n/img/pseudolocalization_settings.webp index c48ea3225..c94827599 100644 Binary files a/tutorials/i18n/img/pseudolocalization_settings.webp and b/tutorials/i18n/img/pseudolocalization_settings.webp differ diff --git a/tutorials/i18n/internationalizing_games.rst b/tutorials/i18n/internationalizing_games.rst index 554c280ef..774bdc52d 100644 --- a/tutorials/i18n/internationalizing_games.rst +++ b/tutorials/i18n/internationalizing_games.rst @@ -29,9 +29,9 @@ Configuring the imported translation Translations can get updated and re-imported when they change, but they still have to be added to the project. This is done in -**Project → Project Settings → Localization**: +:menu:`Project > Project Settings > Localization > Translations`: -.. image:: img/localization_dialog.png +.. image:: img/localization_dialog.webp The above dialog is used to add or remove translations project-wide. @@ -42,9 +42,9 @@ It is also possible to instruct Godot to use alternate versions of assets (resources) depending on the current language. This can be used for localized images such as in-game billboards or localized voices. -The **Remaps** tab can be used for this: +The :ui:`Remaps` tab can be used for this: -.. image:: img/localization_remaps.png +.. image:: img/localization_remaps.webp Select the resource to be remapped then add some alternatives for each locale. @@ -66,7 +66,7 @@ It is recommended to default to the user's preferred language which can be obtained via :ref:`OS.get_locale_language() `. If your game is not available in that language, it will fall back to the :ref:`Fallback ` -in **Project Settings > Internationalization > Locale**, or to ``en`` if empty. +in :menu:`Project > Project Settings > General > Internationalization > Locale`, or to ``en`` if empty. Nevertheless, letting players change the language in game is recommended for various reasons (e.g. translation quality or player preference). @@ -119,8 +119,8 @@ in the current translation, then the text will automatically be translated. This automatic translation behavior may be undesirable in certain cases. For instance, when using a Label to display a player's name, you most likely don't want the player's name to be translated if it matches a translation key. To -disable automatic translation on a specific node, disable **Localization > Auto -Translate** in the inspector. +disable automatic translation on a specific node, set the :ui:`Auto Translate > Mode` +to ``Disabled`` in the inspector. In code, the :ref:`Object.tr() ` function can be used. This will just look up the text in the translations and convert it if found: @@ -337,9 +337,9 @@ word and line breaking require more than rules over character sequences. Godot includes ICU rule and dictionary-based break iterator data, but this data is not included in exported projects by default. -To include it, go to **Project → Project Settings**, enable -**Internationalization → Locale → Include Text Server Data**, -then export the project. Break iterator data is about 4 MB in size. +To include it, go to :menu:`Project > Project Settings > General > Internationalization > Locale` +and enable :ui:`Include Text Server Data`, then export the project. +Break iterator data is about 4 MB in size. Structured text BiDi override ----------------------------- @@ -380,8 +380,8 @@ Testing translations You may want to test a project's translation before releasing it. Godot provides three ways to do this. -First, in the Project Settings, under :menu:`Internationalization > Locale` -(with advanced settings enabled), there is a **Test** property. Set this property +Under :menu:`Project > Project Settings > General > Internationalization > Locale` +(with advanced settings enabled) is a :ui:`Test` property. Set this property to the locale code of the language you want to test. Godot will run the project with that locale when the project is run (either from the editor or when exported). @@ -411,12 +411,12 @@ Translating the project name The project name becomes the app name when exporting to different operating systems and platforms. To specify the project name in more -than one language go to **Project > Project Settings> Application > -Config**. From here click on the button that says ``Localizable String -(Size 0)``. Now there should be a button below that which says ``Add -Translation``. Click on that and it will take you to a page where you -can choose the language (and country if needed) for your project name -translation. After doing that you can now type in the localized name. +than one language go to :menu:`Project > Project Settings > General > Application > +Config`. From here click on the :button:`Localizable String (Size 0)` button, +then the :button:`Add Translation` button. +It will take you to a page where you can choose the language +(and country if needed) for your project name translation. +After doing that you can now type in the localized name. .. image:: img/localized_name.webp diff --git a/tutorials/i18n/localization_using_gettext.rst b/tutorials/i18n/localization_using_gettext.rst index 9210635c2..416024234 100644 --- a/tutorials/i18n/localization_using_gettext.rst +++ b/tutorials/i18n/localization_using_gettext.rst @@ -6,7 +6,7 @@ Localization using gettext (PO files) In addition to importing translations in :ref:`CSV format `, Godot also supports loading translation files written in the GNU gettext format -(text-based ``.po`` and compiled ``.mo`` since Godot 4.0). +(text-based ``.po`` and compiled ``.mo``). .. note:: For an introduction to gettext, check out `A Quick Gettext Tutorial `_. @@ -69,23 +69,23 @@ Creating the PO template Automatic generation using the editor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Since Godot 4.0, the editor can generate a PO template automatically from +The editor can generate a PO template automatically from specified scene and GDScript files. This POT generation also supports translation contexts and pluralization if used in a script, with the optional second argument of ``tr()`` and the ``tr_n()`` method. -Open the Project Settings' **Localization > POT Generation** tab, then use the -**Add…** button to specify the path to your project's scenes and scripts that +Open :menu:`Project > Project Settings > Localization > Template Generation`, then use the +:button:`Add…` button to specify the path to your project's scenes and scripts that contain localizable strings: .. figure:: img/localization_using_gettext_pot_generation.webp :align: center - :alt: Creating a PO template in the Localization > POT Generation tab of the Project Settings + :alt: Creating a PO template in the Localization > Template Generation tab of the Project Settings - Creating a PO template in the **Localization > POT Generation** tab of the Project Settings + Creating a PO template in the :menu:`Localization > Template Generation` tab of the :ui:`Project Settings` -After adding at least one scene or script, click **Generate POT** in the -top-right corner, then specify the path to the output file. This file can be +After adding at least one scene or script, click :button:`Generate` in the +top-right corner, then specify the path to the output file with a ``pot`` file extension. This file can be placed anywhere in the project directory, but it's recommended to keep it in a subdirectory such as ``locale``, as each locale will be defined in its own file. @@ -111,7 +111,7 @@ in the project directory, but it's recommended to keep it in a subdirectory, as each locale will be defined in its own file. Create a directory named ``locale`` in the project directory. In this directory, -save a file named ``messages.pot`` with the following contents: +save a file named ``messages.pot`` with the following content: :: @@ -166,8 +166,8 @@ Loading a messages file in Godot -------------------------------- To register a messages file as a translation in a project, open the -**Project Settings**, then go to the **Localization** tab. -In **Translations**, click **Add…** then choose the ``.po`` or ``.mo`` file +:ui:`Project Settings`, then go to :menu:`Localization > Translations`, +click :button:`Add…` then choose the ``.po`` or ``.mo`` file in the file dialog. The locale will be inferred from the ``"Language: \n"`` property in the messages file. diff --git a/tutorials/i18n/localization_using_spreadsheets.rst b/tutorials/i18n/localization_using_spreadsheets.rst index 5a55b1783..942bd3792 100644 --- a/tutorials/i18n/localization_using_spreadsheets.rst +++ b/tutorials/i18n/localization_using_spreadsheets.rst @@ -137,13 +137,13 @@ translations to load when the game runs, specified in project.godot (or the project settings). Godot allows loading and removing translations at runtime as well. -Select the ``.csv`` file and access the **Import** dock to define import +Select the ``.csv`` file and access the :ui:`Import` dock to define import options. You can toggle the compression of the imported translations, and select the delimiter to use when parsing the CSV file. .. image:: img/import_csv.webp -Be sure to click **Reimport** after any change to these options. +Be sure to click :button:`Reimport` after any change to these options. Loading the CSV file as a translation ------------------------------------- diff --git a/tutorials/i18n/pseudolocalization.rst b/tutorials/i18n/pseudolocalization.rst index 07af4df13..eb56d8b3f 100644 --- a/tutorials/i18n/pseudolocalization.rst +++ b/tutorials/i18n/pseudolocalization.rst @@ -25,8 +25,8 @@ Enabling and configuring pseudolocalization Enabling pseudolocalization and the configurations related to it is as simple as toggling a checkbox in the project settings. These settings can be found in -**Project → Project Settings → General → Internationalization → Pseudolocalization** -after enabling the **Advanced** toggle in the project settings dialog: +:menu:`Project > Project Settings > General > Internationalization > Pseudolocalization` +after enabling the :button:`Advanced` toggle in the project settings dialog: .. image:: img/pseudolocalization_settings.webp