Skip to content

Commit

Permalink
[DOCS] Improve FAQ to custom translations
Browse files Browse the repository at this point in the history
Switch instructions for custom translations from
TypoScript to XLIFF files.
  • Loading branch information
rintisch committed Mar 24, 2024
1 parent 856ea7e commit bc4dfde
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions Documentation/Faq/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
FAQ
===

.. rst-class:: panel panel-default

How can I unset the predefined payment / shipping methods?
==========================================================

Expand Down Expand Up @@ -49,6 +51,8 @@ add options for 2 other countries instead.
}
}
.. rst-class:: panel panel-default

How can I add a field "Addition" for the addresses?
===================================================

Expand All @@ -64,19 +68,21 @@ The following configuration shows the "addition" field for the shipping address:
addition >
}
.. rst-class:: panel panel-default

How can overwrite a translation?
================================

This can be done in TypoScript, the following code snippet shows an example.
You can write your own XLIFF file where you are using the key of the translation
that you want to overwrite. Your XLIFF file needs to be registered in a
:php:`ext_localconf.php`, e.g. in your sitepackage.

.. code-block:: typoscript
caption: EXT:sitepackage/Configuration/TypoScript/setup.typoscript
The following example is for overwriting German translations:

plugin.tx_cart {
_LOCAL_LANG {
de {
tx_cart.mail.thank_you_for_order = Ganz herzlichen Dank für deine Bestellung!
}
}
}
.. code-block:: php
:caption: EXT:sitepackage/ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']
['de']['EXT:cart/Resources/Private/Language/locallang.xlf'][] =
'EXT:sitepackage/Resources/Private/Language/Cart/de.locallang.xlf';

0 comments on commit bc4dfde

Please sign in to comment.