redheadedrod:
you misunderstood me. The principal of localization is enhancing the core codes to accept different
systems not just different "formats" or different "languages".
for example about date/time i talked about a different "date system". please read below to understand the issue:
from ages ago xoops use some definitions for output date/time formatting.
they are located in htdocs/language/LANG/global.php
define('_DATESTRING', 'Y/n/j G:i:s');
define('_MEDIUMDATESTRING', 'Y/n/j G:i');
define('_SHORTDATESTRING', 'Y/n/j');
from 2.5.5 there are some new definitions:
/**
* Additions to 2.5.5
**/
define('_DBDATESTRING', 'Y-m-d');
define('_DBTIMESTRING', 'H:i:s');
define('_DBTIMESTAMPSTRING', 'Y-m-d H:i:s');
[off topic]
it seems they are for input date/time formatting which i dont know why we need These database date/time formats. maybe to store date/times in the database with other formats but i still cannot understand why we need different formats for storing date/time in the database. The "int" format for storing in the database is
definitely fine. why you want to make it messy and harder? i mean then the local parties like us have more issues to change them trough the date system)
[/off topic]
Also we have below variables in htdocs/language/LANG/locale.php
define("_TODAY", "Today G:i");
define("_YESTERDAY", "Yes\te\rday G:i");
define("_MONTHDAY", "n/j G:i");
define("_YEARMONTHDAY", "Y/n/j G:i");
define("_ELAPSE", "%s ago");
define("_TIMEFORMAT_DESC", "Valid formats: "s" - " . _SHORTDATESTRING . "; "m" - " . _MEDIUMDATESTRING . "; "l" - " . _DATESTRING . ";
" . ""c" or "custom" - format determined according to interval to present; "e" - Elapsed; "mysql" - Y-m-d H:i:s;
" . "specified string - Refer to http://php.net/manual/en/function.date.php" rel="external">PHP manual.");
And XOOPS core development team
must move those
file definitions to the database in the future 2.6 version along with too many definitions that i mentioned before.
Quote:
- Please move all possible configurations to the database. eg: captcha configs, image configs,... I can understand some important configurations like debug should be in file because maybe the end user lost its connection to the database. but all other configurations should be in the database. it is just confusing for new users to struggle in the whole xoops files. Also please unify all important configurations to the xoopsconfig.php
But the above are just formatting strings and i dont talk about formatsPersian community use a different date/time system and i can show you by a simple example.
Today is "2012-07-11" in Gregorian Calendar.
Today is "1391-04-21" in Hegira (or Hejira) Calendar.
So you can understand we need completely different functions for this
date system.
I mean we can not use php "date" function. we wrote a "jdate" function and use it just like date function.
jdate will change the date system from Garegorian to Hegira
eg (refer to the image i mentioned before):
Database --> "2012-07-11" ---formatTimestamp--->
jdate local---> "1391-04-21" --> userside
Therefore for example
to localize the "formatTimestamp" xoops function we just need to add below codes to the original "formatTimestamp" in our language locale.php:
// Start hacked by irmtfan
if (_JDF_USE_HEGIRADATE && $format != 'mysql' ){
return jdate($datestring,$usertimestamp);
} else {
return ucfirst(date($datestring,$usertimestamp));
}
// end hacked by irmtfan
hopefully everybody in latin base territories using Gregorian calendar could understand now the localization.