diff --git a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_31.rst b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_31.rst index d8204188ae1..76a6a09ad4d 100644 --- a/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_31.rst +++ b/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_31.rst @@ -125,6 +125,7 @@ Added APIs - New events ``OCP\User\Events\BeforeUserIdUnassignedEvent``, ``OCP\User\Events\UserIdUnassignedEvent``, and ``OCP\User\Events\UserIdAssignedEvent`` have been added to replace the hooks ``\OC\User::preUnassignedUserId``, ``\OC\User::postUnassignedUserId`` and ``\OC\User::assignedUserId``. - New interface ``OCP\Files\Storage\IConstructableStorage`` for storages that can be built by passing only an array to the constructor. - New service ``OCP\RichObjectStrings\IRichTextFormatter`` to format rich text into parsed plain text using its ``richToParsed`` method. +- New magic query parameter ``forceLanguage`` to force a specific language for a web request (API or frontend). See :ref:`Forcing language for a given call`. Changed APIs ^^^^^^^^^^^^ diff --git a/developer_manual/basics/translations.rst b/developer_manual/basics/translations.rst index 5911fb0ad2d..7a745c5a0b2 100644 --- a/developer_manual/basics/translations.rst +++ b/developer_manual/basics/translations.rst @@ -327,3 +327,8 @@ Adding translations ------------------- The steps how to set up translations for an app have been moved to it's own page in the "App development" chapter: :ref:`Translation setup` + +Testing translations +-------------------- + +You can use the query parameter ``forceLanguage`` to force a specific language for a web request (API or frontend). See :ref:`Forcing language for a given call`. diff --git a/developer_manual/client_apis/OCS/ocs-api-overview.rst b/developer_manual/client_apis/OCS/ocs-api-overview.rst index 3696b2c7927..7a6e7b09984 100644 --- a/developer_manual/client_apis/OCS/ocs-api-overview.rst +++ b/developer_manual/client_apis/OCS/ocs-api-overview.rst @@ -255,3 +255,14 @@ In case needed, you can also further filter the auto-complete results on the PHP ``OCP\Collaboration\AutoComplete\AutoCompleteEvent`` event. The event gives you access to the current result set, the item and share types and some more information that you can use to e.g. limit the autocomplete results to users that are actually in the current chat conversation. + +.. _api-force-language: + +Force language for a given call +------------------------------- + +All Nextcloud API calls support forcing the language using the query parameter ``forceLanguage``. It will override any user setting for the given call. + +.. code-block:: bash + + curl -u username:password -X GET 'https://cloud.example.com/ocs/v1.php/...?forceLanguage=en' -H "OCS-APIRequest: true"