# |
Jan 1st 2020, 20:51 |
ndm |
what's the path of your translation file? |
# |
Jan 1st 2020, 20:48 |
Rob73 |
en_GB worked just now but zh_CH didin't |
# |
Jan 1st 2020, 20:47 |
ndm |
maybe your translation files are in the wrong place |
# |
Jan 1st 2020, 20:46 |
Rob73 |
for some reason it won't work. |
# |
Jan 1st 2020, 20:41 |
ndm |
That looks OK, yes, assuming the relevant `msgstr` entries exist. Translations are being cached, try clearing `tmp/cache/persistent`. |
# |
Jan 1st 2020, 20:39 |
Rob73 |
Time format changes as you can see |
# |
Jan 1st 2020, 20:38 |
Rob73 |
I mean, generally that should work when the language is changed I have en_GB and zh_CH but the text wont change to chinese |
# |
Jan 1st 2020, 20:37 |
ndm |
Not sure what you mean by "correct"? |
# |
Jan 1st 2020, 20:34 |
Rob73 |
this is the correct method right ? |
# |
Jan 1st 2020, 20:34 |
Rob73 |
<?php echo __("Greetings governor {0} !", [$this->request->getSession()->read('Auth.User.username')]); ?> |
# |
Jan 1st 2020, 20:33 |
Rob73 |
msgid "Greetings governor {0} !" |
# |
Jan 1st 2020, 20:33 |
Rob73 |
one more question real quick. |
# |
Jan 1st 2020, 20:32 |
ndm |
you're welcome |
# |
Jan 1st 2020, 20:32 |
Rob73 |
this is very useful :) Thanks again :D |
# |
Jan 1st 2020, 20:31 |
Rob73 |
if(!($fams_b->ark_date->isPast()) AND $fams_b->ark_date->isWithinNext('1 week')) |
# |
Jan 1st 2020, 20:31 |
ndm |
Alrighty, then `iasPast()` is fine :) |
# |
Jan 1st 2020, 20:30 |
Rob73 |
_now_ H:M:S |
# |
Jan 1st 2020, 20:29 |
ndm |
Just to make sure, you want to check whether it's before _now_, not before _the start of the current day_? |
# |
Jan 1st 2020, 20:27 |
Rob73 |
'$arker_d->ark_date->isPast()' this worked. I will look into it more and update my project. Thank you |
# |
Jan 1st 2020, 20:24 |
ndm |
https://book.cakephp.org/4/en/core-libraries/time.html#comparing-with-the-present |
# |
Jan 1st 2020, 20:23 |
ndm |
https://book.cakephp.org/chronos/1/en/index.html |
# |
Jan 1st 2020, 20:23 |
ndm |
The datetime objects that CakePHP uses offer all sorts of comparison methods, and they can be compared against each other using standard PHP comparison operators. Your check looks like you want to test for the past, ie whether `$arker_d->ark_date` is in the past: `$arker_d->ark_date->isPast()` |
# |
Jan 1st 2020, 20:21 |
Rob73 |
check if $today is bigger than $arker_d->ark_date |
# |
Jan 1st 2020, 20:20 |
Rob73 |
if it's bigger |
# |
Jan 1st 2020, 20:20 |
ndm |
So you want to check if a given date is today? |
# |
Jan 1st 2020, 20:20 |
Rob73 |
but it's breaking |
# |
Jan 1st 2020, 20:20 |
Rob73 |
it's rather simple |
# |
Jan 1st 2020, 20:19 |
Rob73 |
$today = date("Y-m-d\TH:i:sP"); |
# |
Jan 1st 2020, 20:19 |
ndm |
Well that's a different problem. What exactly does your comparison look like? |
# |
Jan 1st 2020, 20:16 |
Rob73 |
Sure it's the same date, but the format is different and therefore my php comparison return false when it should be true |
# |
Jan 1st 2020, 20:15 |
ndm |
That's both the same time, ie no timezone change. |
# |
Jan 1st 2020, 20:07 |
Rob73 |
I change the language using I18n::setLocale("zh_CH"); |
# |
Jan 1st 2020, 20:05 |
Rob73 |
Hello, is it possible to use I18n for multi-language site but not change timezone ? en_GB is 02/01/2020 20:00, when switching to zh_CH (China) it becomes this: 20/1/2 下午8:00 and it breaking my pages |
# |
Jan 1st 2020, 18:09 |
slackebot |
it was a database connection issue? |
# |
Jan 1st 2020, 18:09 |
kailas |
What’s the best/right way to handle intermittent, transient, errors while saving and test it? in a production system, in periods of increased database load, i’ve noticed that some of my saves seem to fail. my best guess at how to handle was to just keep trying to save up to n times, then quit. Also, how do you get the reason the save failed (if it wasn’t a validation error)? the return value from save is just null, right? how to know |
# |
Jan 1st 2020, 17:08 |
brandon |
@adamd Sorry for late reply - I deleted the lock file and got the same message. |
# |
Jan 1st 2020, 04:51 |
admad |
@luizcmarin https://github.com/UseMuffin/Orderly |
# |
Dec 31st 2019, 21:47 |
alexdd55976 |
Happy new year to everyone of this great cake community wherever you are on this planet. Thanks to all developers. Keep up this great work. |
# |
Dec 31st 2019, 20:35 |
luizcmarin |
thank you |
# |
Dec 31st 2019, 20:35 |
ricksaccous |
good luck |
# |
Dec 31st 2019, 20:35 |
ricksaccous |
something like that |