Commit Graph

3 Commits

Author SHA1 Message Date
Maurício Meneghini Fauth
144f13a38d
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2025-05-10 15:41:10 -03:00
Maurício Meneghini Fauth
90ee00efd5
Create the 'pma' global variable for Twig templates
Creates the Twig\PmaGlobalVariable class to handle the 'pma' Twig global
variable.

The idea of this global variable is to automatically inject in all
templates some useful information.

For now it only includes `pma.version` to get the phpMyAdmin version
and `pma.text_dir` to get the text direction ('ltr' or 'rtl').

Adding new variables to the `pma` global variable should be done with
caution.

- https://twig.symfony.com/doc/3.x/advanced.html#globals

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-07-09 20:30:48 -03:00
Maurício Meneghini Fauth
b920681947
Add t function to Twig\I18nExtension
For translations, a Twig function is more versatile than a Twig tag and
has the benefit of auto escaping.

As the phpmyadmin/twig-i18n-extension package is a fork of the Twig's
I18nExtension, the custom function was added to the phpMyAdmin main
repository, this way the cases not used by phpMyAdmin don't need to be
implemented. For example, only the default domain is used and
MoTranslator is always available.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-04-23 16:34:14 -03:00