Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Date Language


Rui Ganga

Recommended Posts

Hi

 

I have a complicated situation with a a very simple solution ( I hope so!).

 

My site is in Portuguese. The only language that is used in my store is Portugueses BUT the dates are shown in English like: Este artigo foi introduzido em Thursday 16 November, 2006. (this is the part that says your product was added... (date)...

So what i need is to know what file can I translate so the Months and the days of the week can be in Portuguese.

 

If there is someone that can solve this complicate and at the same time simple situation pelase advise me!

 

Regards.

Rui Ganga

Link to comment
Share on other sites

Hi

 

I have a complicated situation with a a very simple solution ( I hope so!).

 

My site is in Portuguese. The only language that is used in my store is Portugueses BUT the dates are shown in English like: Este artigo foi introduzido em Thursday 16 November, 2006. (this is the part that says your product was added... (date)...

So what i need is to know what file can I translate so the Months and the days of the week can be in Portuguese.

 

If there is someone that can solve this complicate and at the same time simple situation pelase advise me!

 

Regards.

 

Hello, I think you don't need to translate any language, I had this problem one year ago when I start , and the solution is in the file portuguese.php . in the first part . Look for example the spanish and french. Revise only in this part your file portuguese.php. I am not sure, but tried.

 

 

<?php

/*

$Id: espanol.php,v 1.107 2003/07/09 18:13:39 dgw_ Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// look in your $PATH_LOCALE/locale directory for available locales

// or type locale -a on the server.

// Examples:

// on RedHat try 'es_ES'

// on FreeBSD try 'es_ES.ISO_8859-1'

// on Windows try 'sp', or 'Spanish'

@setlocale(LC_TIME, 'es_ES.ISO_8859-1');

 

define('DATE_FORMAT_SHORT', '%d/%m/%Y'); // this is used for strftime()

define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()

define('DATE_FORMAT', 'd/m/Y'); // this is used for date()

define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

 

////

// Return date in raw format

// $date should be in format mm/dd/yyyy

// raw date is in format YYYYMMDD, or DDMMYYYY

function tep_date_raw($date, $reverse = false) {

if ($reverse) {

return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);

} else {

return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);

}

}

 

// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)

define('LANGUAGE_CURRENCY', 'EUR');

 

// Global entries for the <html> tag

define('HTML_PARAMS','dir="LTR" lang="es"');

 

********************************************************

and german:

 

<?php

/*

$Id: german.php,v 1.124 2003/07/11 09:03:49 jan0815 Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// look in your $PATH_LOCALE/locale directory for available locales

// or type locale -a on the server.

// Examples:

// on RedHat try 'de_DE'

// on FreeBSD try 'de_DE.ISO_8859-1'

// on Windows try 'de' or 'German'

@setlocale(LC_TIME, 'de_DE.ISO_8859-1');

 

define('DATE_FORMAT_SHORT', '%d.%m.%Y'); // this is used for strftime()

define('DATE_FORMAT_LONG', '%A, %d. %B %Y'); // this is used for strftime()

define('DATE_FORMAT', 'd.m.Y'); // this is used for strftime()

define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

 

////

// Return date in raw format

// $date should be in format mm/dd/yyyy

// raw date is in format YYYYMMDD, or DDMMYYYY

function tep_date_raw($date, $reverse = false) {

if ($reverse) {

return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);

} else {

return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);

}

}

 

// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)

define('LANGUAGE_CURRENCY', 'EUR');

 

// Global entries for the <html> tag

define('HTML_PARAMS','dir="LTR" lang="de"');

 

 

 

 

 

Regards, Nelson

Link to comment
Share on other sites

Hey

 

Your help helped me understand how this works. The date is asked to the server, that answer in some language. I put the changes in espanol.php file and the date shown was in spanish (months and days of week). This is a big thing to me. Thanks for help but i still can't put the portuguese date.

 

I hope someone can tell me what i should write in portugues.php file so the date is fixed in PORTUGUÊS!

 

Regards

Rui Ganga

Link to comment
Share on other sites

Hi

 

Now I can understand that tha dat language date is asked to the server. So can't be tranlated in any file. I changed the english to portuguese with no dificulty but I don't know what I need to write in:

@setlocale(LC_TIME, 'de_DE.ISO_8859-1');

to put the date in Portuguese. I tried almost everything...

 

If somebody have some idea, please post!

 

Thanks

Rui Ganga

Link to comment
Share on other sites

Hey.

 

In a flashlight in my head i discovered!

 

I put just:

'pt_PT.ISO_8859-1'

an it worked!

 

I remeber to try it before but i must hed forgot anything.

 

Thanks for the help Nelson Vargas.

 

 

Regards

Rui Ganga

Link to comment
Share on other sites

Sorry for the language mistakes. When I'm happy for reach something i write very fast and thats what happend- mistakes!

 

B cool

 

 

I am happy you had success.

Exitos y hasta pronto amigo.

 

Spanish is close to portuguese.

 

Nelson

Link to comment
Share on other sites

  • 2 weeks later...
I am happy you had success.

Exitos y hasta pronto amigo.

 

Spanish is close to portuguese.

 

Nelson

 

Hello Nelson & Rui,

 

I have the very same problem, i tried your solution(s) but they didn't work out...

 

what should i do more?

 

Tks in advance

 

Hugo

Link to comment
Share on other sites

  • 1 month later...

Hi, just solved the problem ... at least for me on a linux server

 

I had the correct LC_TIME set but still had english names for day of week and month

 

The problem: locales where only generated for US

Solution: add your locales to /etc/locale.gen and execute locale-gen (this was on debian sarge, as root)

 

hope this helps

Link to comment
Share on other sites

  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...