I can't find any package for slim to translate content?

I found only symfony/translator wish is not the same and it’s not clear to use.
is there any other packages i can use ??

Can you elaborate on why you don’t wish to or cannot use symfony/translator? Are you missing instructions on using it with Slim?

As an alternative you can use illuminate/translation, which is part of Laravel. There is an example of using illuminate/translation with Slim instead of Laravel at https://github.com/mattstauffer/Torch/tree/master/components/translation.

can you provide me with some useful tutorial or code example in slim ?


There is an example given at https://helgesverre.com/blog/i18n-slim-framework-translation-twig/. It seems to use Slim Framework 2 instead of Slim Framework 3, though you may be able to adapt it.

I have created a minimal Slim 3 example application that uses Twig for view rendering and illuminate/translation for translations, which you can find at https://github.com/llvdl/Slim-Translations-Example. As demonstrated in the example (see app/bootstrap.php), you can register methods to the Twig renderer, in this case the trans and transChoice methods.