# |
Mar 29th 2019, 14:22 |
jksM |
I see that the locale is indeed changed, as date/time is now shown according to the chosen location, but texts are still not translated. |
# |
Mar 29th 2019, 14:21 |
jksM |
I'm having trouble getting gettext based translations working with cakephp 3.7... followed the cookbook, but the text is still displayed in English. I have marked up the text with __(), used i18n extra to create the .pot file, created /src/Locale/da/default.po with translations, and set defaultLocale in config/app.php to da. Any ideas on what I could be missing here? |
# |
Mar 29th 2019, 14:14 |
joopm |
i read a lot the cookbook, also the logs here but quite often i faced some new things what i can not solve myself.. |
# |
Mar 29th 2019, 14:13 |
joopm |
thank you,i am a member since cake 2.1 |
# |
Mar 29th 2019, 14:13 |
joopm |
just dont understand that it was working in AppController without the getController |
# |
Mar 29th 2019, 14:13 |
admad |
you will with time :slightly_smiling_face: |
# |
Mar 29th 2019, 14:12 |
joopm |
i wish i could have deeper knowledge |
# |
Mar 29th 2019, 14:12 |
joopm |
thank you admad your help |
# |
Mar 29th 2019, 14:09 |
admad |
access it using `$this->getController()->viewBuilder()` |
# |
Mar 29th 2019, 14:08 |
admad |
just adding a "use" statement does not magically provided you an instance of that class |
# |
Mar 29th 2019, 14:05 |
joopm |
i appended use Cake\View\ViewBuilder; but does not solve the issue |
# |
Mar 29th 2019, 14:04 |
joopm |
is anyone know why i get undefinied method error to viewBuilder in my component? |
# |
Mar 29th 2019, 14:03 |
liaogz82 |
ok thanks |
# |
Mar 29th 2019, 14:02 |
admad |
@liaogz82 @markstory might be able to help you |
# |
Mar 29th 2019, 14:01 |
liaogz82 |
or someone to double check it |
# |
Mar 29th 2019, 14:00 |
grossolive4 |
hello |
# |
Mar 29th 2019, 13:57 |
liaogz82 |
who do I ask? |
# |
Mar 29th 2019, 13:57 |
liaogz82 |
i need resources to prep my slides |
# |
Mar 29th 2019, 13:57 |
liaogz82 |
theme framework wars |
# |
Mar 29th 2019, 13:57 |
liaogz82 |
https://2019.phpconf.asia/ |
# |
Mar 29th 2019, 13:57 |
liaogz82 |
i am tasked to present about cakephp in the next phpconfasia |
# |
Mar 29th 2019, 13:56 |
liaogz82 |
hi another request |
# |
Mar 29th 2019, 13:50 |
liaogz82 |
its default there |
# |
Mar 29th 2019, 13:48 |
ricksaccous |
ohhh ok |
# |
Mar 29th 2019, 13:48 |
liaogz82 |
i have to comment his out |
# |
Mar 29th 2019, 13:48 |
liaogz82 |
my routes.php has this `$routes->applyMiddleware('csrf');` |
# |
Mar 29th 2019, 13:46 |
ricksaccous |
unless you are using your own csrf solution |
# |
Mar 29th 2019, 13:46 |
ricksaccous |
and if you aren't loading it then your api request is not a csrf problem |
# |
Mar 29th 2019, 13:45 |
ricksaccous |
$this->loadComponent('Csrf'); |
# |
Mar 29th 2019, 13:45 |
ricksaccous |
it should be this one |
# |
Mar 29th 2019, 13:45 |
ricksaccous |
wait |
# |
Mar 29th 2019, 13:45 |
ricksaccous |
$this->loadComponent('Security'); |
# |
Mar 29th 2019, 13:45 |
ricksaccous |
what about |
# |
Mar 29th 2019, 13:44 |
liaogz82 |
no it is not there |
# |
Mar 29th 2019, 13:44 |
ricksaccous |
in your code find $this->loadComponent('CSRF'); or whatever it's called |
# |
Mar 29th 2019, 13:44 |
ricksaccous |
;) |
# |
Mar 29th 2019, 13:44 |
ricksaccous |
it is loaded somewhere |
# |
Mar 29th 2019, 13:41 |
liaogz82 |
is there a way to turn it off? |
# |
Mar 29th 2019, 13:41 |
liaogz82 |
no i did not load it in AppController |
# |
Mar 29th 2019, 13:40 |
ricksaccous |
just don't load component if it's api request |
# |
Mar 29th 2019, 13:40 |
ricksaccous |
CSRF is a component isn't it? |