Translation For Static Words
Created 6 years ago by richardoctoeyHi guys, I guess that pyrocms is able to translate static words. because I watch it from here: https://pyrocms.com/videos/series/extending-pyrocms/overriding-translations
My problem is: I want to write down translate-able static words. So in the view I put:
trans('wosh') then in the lang/en/addon.php I add return [ 'wosh' => 'wow', ];
but it print wosh, instead of wow. I'm sure that i'm in en locale, because i'm put http://localhost:8000/?_locale=en in the url and the content return the english content. I think I am doing it wrong, thanks for help.
@ryanthompson hi if it was in the theme let's say I was made it with: php artisan make:addon myname.theme.mythemename then it should be {{ trans('myname.theme.mythemename::addon/wosh') }} is that correct? because it just write myname.theme.mythemename::addon/wosh in the view
addon.wosh
should do it
Laravel's finders for views / lang / config behave a little different with /
vs .
.
to people out there searching for language translation for static word you use this:
{{ trans('your_company.module.example_addon::addon.wosh') }} thanks ryan for your help
Hey there! All translations need to be namespaced. So for example something like this will work: