Rui Ganga Posted November 26, 2006 Posted November 26, 2006 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. Quote Rui Ganga
nelsonevp Posted November 27, 2006 Posted November 27, 2006 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 Quote
Rui Ganga Posted November 28, 2006 Author Posted November 28, 2006 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 Quote Rui Ganga
Rui Ganga Posted November 28, 2006 Author Posted November 28, 2006 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 Quote Rui Ganga
Rui Ganga Posted November 28, 2006 Author Posted November 28, 2006 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 Quote Rui Ganga
Rui Ganga Posted November 28, 2006 Author Posted November 28, 2006 Sorry for the language mistakes. When I'm happy for reach something i write very fast and thats what happend- mistakes! B cool Quote Rui Ganga
nelsonevp Posted November 29, 2006 Posted November 29, 2006 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 Quote
huguix Posted December 13, 2006 Posted December 13, 2006 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 Quote
textheone Posted January 20, 2007 Posted January 20, 2007 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 Quote
d_paulo Posted November 10, 2007 Posted November 10, 2007 Many thanks from my side too :thumbsup: It worked just fine for Ro language :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.