Author Topic: Decimal + Date Format Problems (DE_AT_CH, NL) at German & maybe other Webhoster  (Read 680 times)

Offline Lahmizzar

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
in some cases and probably with new vServers and Plesk Installed you have to do the following to set comma instead of dot


as in an other thread by netshine postet change the following

In /administrator/components/com_nbill/framework/nbill.number.format.php, where it says (on lines 38 to 41):

if (nbf_globals::$system_locale)
{
    @setlocale(LC_ALL, nbf_globals::$system_locale); //You could force this to a different locale here if your system default one is not right
}

...change it to:

/*if (nbf_globals::$system_locale)
{
    @setlocale(LC_ALL, nbf_globals::$system_locale); //You could force this to a different locale here if your system default one is not right
}*/
setlocale(LC_ALL, 'nl_NL', 'nl', 'NL', 'nl-NL', 'Dutch');

But here it comes ... change the above settings (if they don't work) to the following  


First of all we have to look which locales / languages are installed

(NOTE: you have to be a Serveradmin with ubuntu/debian installed for this how-to, try the following to install new language packs)

Code: [Select]
locale -a // from the root shell to see what languages are installed and therefore which you have to install

Install the following packs (--> or sudo apt-get....)
Code: [Select]
apt-get install language-pack-de-base  // for the German Language Pack
Code: [Select]
apt-get install language-pack-fi-base  // for the Finnish Language Pack
Code: [Select]
apt-get install language-pack-en-base  // for the English Language Pack
Code: [Select]
apt-get install language-pack-nl-base  // for the Netherland Language Pack

test your installed locales with

Code: [Select]
locale -a // from the root shell

the list looks like this one
de_AT.utf8
de_BE.utf8
de_CH.utf8
de_LI.utf8
de_LU.utf8
en_AG
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_NG
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
fi_FI.utf8
nl_AW.utf8
nl_BE.utf8
nl_NL.utf8


The last thing you need to do after installing the correct language pack is restart Apache with
Code: [Select]
apache2ctl restartThe locale "de_DE.utf8" or "nl_NL.utf8" can then be used in PHP5 after restarting Apache.

For setting the German timezone and locale in PHP use:

<?php
setlocale(LC_ALL, array('de_DE.UTF-8','de_DE@euro','de_DE','german'));
?>


you'll see a list with all installed locals

otherwise, if your not an administrator point your isp or admin to this thread if they don't know how to set it up...





If you wish to display the date formatted in invoice template add the following red line at the top of your invoice templates index.php
<?php $date_format = "d.m.Y"; ?> at line 5 in this example

the path to your invoice templates: JoomlaRootDir/compoments/com_nbill/templates/anything with invoice/index.php
Code: [Select]
Line01: <?php
Line02
: (defined('_VALID_MOS') ..........
Line03:?>

Line04:
Line05:<?php $date_format "d.m.Y"?>
Line06:
Line07: <?php if (!$pdf) .........

It shows the date: 01.01.1970

"d m Y" shows the date: 01 01 1970
"d m y" shows the date: 01.01.70
and so on...

If you want to change this date in the global config section, theres still a problem with overall dateformats.. eg if you reopen an existing invoice/quote or a order it won't be catch the correct date from the database....

But the customers who will download or show an invoice - everytime see the date you've set.



have fun
« Last Edit: 22/March/2011, 06:05:29 PM by Lahmizzar »
The mainproblem is, it must be faster

 

anything