Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
8 - 7 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     
0) ? _TODAY : _YESTERDAY;[/code] Now there is also another file called calendar.php that has a really neat variable called _CAL_TODAY define('_CAL_TODAY', 'Aujourd\'hui'); I tried to be clever by replacing [code]$datestring = ($elapse_today > 0) ? _TODAY : _YESTERDAY;[/code] With this [code]$datestring = ($elapse_today > 0) ? _CAL_TODAY : _CAL_YESTERDAY;[/code] in class/xoopslocal.php and I also added _CAL_YESTERDAY to the calendar.php file as it was not present but it didn’t work. I don’t know PHP but wanted to know if there is an easy way to fix it like I wanted by using calendar.php (if there is not risk to have side effects) ? Also just out of curiosity why define('_TODAY', "\T\o\d\a\y G:i"); and not define('_TODAY', "Today"); in local.php?[/quote]" />

Small display issue in date for yesterday and today
by fabou78 on 2019/9/16 11:40:28

I was looking at an issue where dates for posts from yesterday or today would not display correctly in my language (French).

I found an error in our locale file language/french/locale.php ;

define('_TODAY', "\A\u\j\o\u\r\d\'\h\u\i G:i");
define('_YESTERDAY', "\H\i\e\r G:i");

The issue is that \r \e seem to be special characters and have not been translated properly in French so I can easily fix this by doing double back slash \\e and \\r like I have seen in the English version of the file language/english/locale.php

The function that is returning the date string is located in class/xoopslocal.php and at line 98 I can see the reference to _TODAY and _YESTERDAY defined in local.php

le="color: #000000"><?php $datestring = ($elapse_today > 0) ? _TODAY : _YESTERDAY;


Now there is also another file called calendar.php that has a really neat variable called _CAL_TODAY

define('_CAL_TODAY', 'Aujourd\'hui');

I tried to be clever by replacing

le="color: #000000"><?php $datestring = ($elapse_today > 0) ? _TODAY : _YESTERDAY;


With this

le="color: #000000"><?php $datestring = ($elapse_today > 0) ? _CAL_TODAY : _CAL_YESTERDAY;



in class/xoopslocal.php and I also added _CAL_YESTERDAY to the calendar.php file as it was not present but it didn’t work.


I don’t know PHP but wanted to know if there is an easy way to fix it like I wanted by using calendar.php (if there is not risk to have side effects) ?

Also just out of curiosity why define('_TODAY', "\T\o\d\a\y G:i"); and not define('_TODAY', "Today"); in local.php?

Who's Online

77 user(s) are online (36 user(s) are browsing Support Forums)


Members: 0


Guests: 77


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits