OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Date Language
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Languages and Zones
Rui Ganga
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.
nelsonevp
QUOTE (Rui Ganga @ Nov 26 2006, 06:25 PM) *
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
Rui Ganga
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
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
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
Sorry for the language mistakes. When I'm happy for reach something i write very fast and thats what happend- mistakes!

B cool
nelsonevp
QUOTE (Rui Ganga @ Nov 28 2006, 05:38 AM) *
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
huguix
QUOTE (nelsonevp @ Nov 29 2006, 07:04 AM) *
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
textheone
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
d_paulo
Many thanks from my side too thumbsup.gif It worked just fine for Ro language smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.