Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #384 - Added translation of variable #398

Merged
merged 4 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion locale/admin-docs.pot
Original file line number Diff line number Diff line change
Expand Up @@ -19061,7 +19061,7 @@ msgid "Please note that this is just an overview of available variables. It migh
msgstr ""

#: ../system/variables.rst:10
msgid "Variables can be called by typing ``::`` (just like text modules in the frontend), as long as you're in a supported text field within the Backend. Zammad will show display all variables being available within this context and replace it to the variable as soon as you selected an entry."
msgid "Variables can be called by typing ``::`` (just like text modules in the frontend), as long as you're in a supported text field within the backend. Zammad will display all variables being available within this context and replace it to the variable as soon as you selected an entry."
msgstr ""

#: ../system/variables.rst:15
Expand Down Expand Up @@ -19108,6 +19108,18 @@ msgstr ""
msgid "Now, in some situations it's possible that you'll need to use a third part. The best example for such a situation would be a ``select`` or ``tree-select`` field which will by default return the key value, not it's display name. For this, just extend your variable with ``.value``. This will result in ``#{ticket.select.value}``."
msgstr ""

#: ../system/variables.rst:58
msgid "Using translated variables"
msgstr ""

#: ../system/variables.rst:60
msgid "If you want to use a translated variable in triggers or schedulers, you can extend the placeholder like this: ``#{t(ticket.state.name)}``. The ``t`` tells Zammad to search for fitting translated strings. The used output language is based on the system language of Zammad which you can set in the admin panel under :doc:`/settings/branding`."
msgstr ""

#: ../system/variables.rst:66
msgid "A possible use-case: you want to send your customers updates on tickets via trigger or scheduler which should include the state of the ticket. Using the default ``#{ticket.state.name}`` (without the translation flag ``t()``) would lead to the output of the original (english) name of the state."
msgstr ""

#: ../system/variables/article.rst:2
msgid "Articles"
msgstr ""
Expand Down
18 changes: 16 additions & 2 deletions system/variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Variables
`Community <https://community.zammad.org>`_.

Variables can be called by typing ``::`` (just like text modules in the
frontend), as long as you're in a supported text field within the Backend.
Zammad will show display all variables being available within this context and
frontend), as long as you're in a supported text field within the backend.
Zammad will display all variables being available within this context and
replace it to the variable as soon as you selected an entry.

.. hint:: You have an empty field which you referenced and it appears as ``-``?
Expand Down Expand Up @@ -53,3 +53,17 @@ The best example for such a situation would be a ``select`` or ``tree-select``
field which will by default return the key value, not it's display name.
For this, just extend your variable with ``.value``. This will result in
``#{ticket.select.value}``.

Using translated variables
--------------------------

If you want to use a translated variable in triggers or
schedulers, you can extend the placeholder like this:
``#{t(ticket.state.name)}``. The ``t`` tells Zammad to search for fitting
translated strings. The used output language is based on the system language of
Zammad which you can set in the admin panel under :doc:`/settings/branding`.

A possible use-case: you want to send your customers updates on tickets
via trigger or scheduler which should include the state of the ticket. Using the
default ``#{ticket.state.name}`` (without the translation flag ``t()``) would
lead to the output of the original (english) name of the state.