- Issue created by @geek-merlin
- 🇪🇸Spain Jose Reyero
For more syntactic sugar, see locale_extend_ns, I had it around, just added.
https://git.drupalcode.org/sandbox/reyero-3337204/-/blob/1.0.x/locale_ex...
// Anywhere in modules or classes. use function Drupal\locale_extend\es\tr; // Will translate from Spanish tr("Hola");
- 🇩🇪Germany geek-merlin Freiburg, Germany
Nice! namespace magick...
Maybe better (and scalable): __call_static:
T::es('Hola!')
- 🇪🇸Spain Jose Reyero
Yess to static calls!!
Already added,
and reorganized modules (t_es, t_de moved to submodule), see https://git.drupalcode.org/sandbox/reyero-3337204use Drupal\locale_extend\Translate; Translate::es("Hola");
or, as you like...
use Drupal\locale_extend\Translate as T; T::es("Hola");
Thanks for the idea, I think this is starting to look good.. :)
- 🇩🇪Germany geek-merlin Freiburg, Germany
Great you like it!
Still thinking how to relate or integrate this and that, once it's stable. Like it a lot.
- Status changed to Closed: duplicate
about 1 year ago 2:17pm 30 October 2023