Skip to content
Snippets Groups Projects
Commit 03e556ca authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[DOCS] Fix formatting and typos in changelog

Resolves: #99709
Related: #99694
Releases: main
Change-Id: I5117bb39a016ae9acc7e6a4b42d8feff1d3ae05c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77598


Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
parent dff9676f
Branches
Tags
No related merge requests found
......@@ -11,42 +11,45 @@ See :issue:`99694`
Description
===========
TYPO3 internally now uses a "locale" format following the IETF RFC 5646 language
tag standard (https://www.rfc-editor.org/rfc/rfc5646.html).
TYPO3 internally now uses a "locale" format following the
`IETF RFC 5646 language tag standard <https://www.rfc-editor.org/rfc/rfc5646.html>`__.
A locale supported by TYPO3 consists of the following parts (tags and subtags):
* ISO 639-1 / ISO 639-2 compatible Language Key in lower-case (such as "fr" French, or "de" for German)
* optionally the ISO 15924 compatible language script system (4 letter, such as "Hans" as in "zh_Hans")
* optionally the region / country code according to ISO 3166-1 standard in upper camelcase such as "AT" for Austria.
Examples for a locale string are
Examples for a locale string are:
* "en" for English
* "pt" for Portuguese
* "da-DK" for Danish as used in Denmark
* "de-CH" for German as used in Switzerland
* "zh-Hans-CN" for Chinese with the simplified script as spoken in China (mainland)
A new PHP object "Locale" automatically separates each tag and subtag into
A new PHP object :php:`Locale` automatically separates each tag and subtag into
these parts.
The Locale object can now be used to instantiate a new LanguageService object for
translating labels. Previous, TYPO3 used the "default" language key, instead of
the locale "en" to identify the english language. Both are supported, but it is
encouraged to use "en-US" or "en-GB" with the region subtag to identify the chosen
language more precisely.
The :php:`Locale` object can now be used to instantiate a new
:php:`LanguageService` object for translating labels. Previously, TYPO3 used
the `default` language key instead of the locale `en` to identify the English
language. Both are supported, but it is encouraged to use `en-US` or `en-GB`
with the region subtag to identify the chosen language more precisely.
Impact
======
Example for using the Locale for creating a "LanguageService" object for translations:
Example for using the :php:`Locale` for creating a :php:`LanguageService` object
for translations:
.. code-block:: php
.. code-block:: php
$languageService = $languageServiceFactory->create(new Locale('de-AT'));
$myTranslatedString = $languageService->sL('LLL:EXT:my_extension/Resources/Private/Language/myfile.xlf:my-label');
$languageService = $languageServiceFactory->create(new Locale('de-AT'));
$myTranslatedString = $languageService->sL('LLL:EXT:my_extension/Resources/Private/Language/myfile.xlf:my-label');
This is highly recommended, as the wrappers php:`$GLOBALS['LANG']->sL()` and
:php:`$GLOBALS['TSFE']->sL()`will be deprecated in the future.
This is highly recommended, as the wrappers :php:`$GLOBALS['LANG']->sL()` and
:php:`$GLOBALS['TSFE']->sL()` will be deprecated in the future.
.. index:: PHP-API, ext:core
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment