chrometweaks.org

Which type of web iPage hosting service should you buy to host a LISTSERV?

Click Here To View All Answers...


My question is Which type of web iPage hosting service should you buy to host a LISTSERV? Many thanks for any response. My other question... NOTE: I searched ALL OVER the frum to get the anwer for this problem, and my problem isn't the GMT, I don't care about the hour, only about the language of the date..

Hi, my english isn't so good so I will try to explain it as better possible, if you don't undertand ask me and I will try to explain it again, ok?.

I use the 2.2 version, and everything is working fine, but my default language is portuguese, and all my shop are in portuguese, but the date don't. I know that I need to change the @setlocale(LC_TIME ... but my does not seen to have the date in my language. I tryed :.

@setlocale(LC_TIME, 'pt_PT.ISO_8859-1'); (does not work).

@setlocale(LC_ALL, 'pt_PT'); (doesn't work).

@setlocale(LC_ALL, 'pt'); (doesn't work).

@setlocale(LC_ALL, 'Portuguese'); (doesn't work).

And I tryed it all only changing the pt_PT to pt_BR but doesn't work too. To change the date language to spanish ou english was really easy, but I think the server doesn't have my language... :/.

Ah, I changed that line too:.

Define('HTML_PARAMS','dir="LTR" lang="pt"');.

NOTE: The iso is correct, I found it in a website..

There are any mod or some way to show the date in my language without take it from the server? I want to show not only in the footer, but in all the site, like in the "Este produto foi adicionado em.. / This product was added in... " Could someone help me?..

Comments (15)

Hmm... I need to find out myself. I don't know what is the answer to your question. I'll do some investigation and get back to you if I got an answer. You should email the people at iPage as they probably could give you an answer..

Comment #1

If you have shell access - you can check /usr/share/locale for your language.

If it isn't there you can ask your ISP to install it..

If they won't for some reason then you can either change ISP or put a wrapper around the strftime function.

I.e..

Function my_strftime( format, time_stamp )  {.

$result = strftime( format, time_stamp );.

$result = ereg_replace("Thursday","Jueves",$result);.

... etc for all the other strings.

Return $result.

}.

Which obviously would be jumping through hoops - but isn't too tricky to do...

Comment #2

Thanks, meltus. But I am just a newbie in php, so could you give some more help? I need to do it:.

Right?.

And I need to past it in my catalog/includes/languages/portuguese.php, after the.

?.

If it's just it what I need to do, I got this error:.

Parse error: parse error, expecting `')'' on line 24 of my portuguese.php.

The line 24 is.

Function my_strftime(format, time_stamp) {.

I know that question sound stupid for u, but I really wanna understand it...

Comment #3

Function my_strftime(format, time_stamp).

All variables need $ in front, e.g..

Function my_strftime($format, $time_stamp).

Good luck,.

Matt..

Comment #4

I'd prbably try to get the real stuff installed - but here is the code anyway.

Function my_strftime($format, $time_stamp) {.

$result = strftime($format, $time_stamp);.

$result = ereg_replace("January","Janeiro",$result);.

$result = ereg_replace("February","Fevereiro",$result);.

$result = ereg_replace("March","Maro",$result);.

$result = ereg_replace("April","Abril",$result);.

$result = ereg_replace("May","Maio",$result);.

$result = ereg_replace("June","Junho",$result);.

$result = ereg_replace("July","Julho",$result);.

$result = ereg_replace("August","Agosto",$result);.

$result = ereg_replace("September","Setembro",$result);.

$result = ereg_replace("October","Outubro",$result);.

$result = ereg_replace("November","Novembro",$result);.

$result = ereg_replace("December","Dezembro",$result);.

$result = ereg_replace("Sunday","Domingo",$result);.

$result = ereg_replace("Monday","Segunda",$result);.

$result = ereg_replace("Tuesday","Tera",$result);.

$result = ereg_replace("Wednesday","Quarta",$result);.

$result = ereg_replace("Thursday","Quinta",$result);.

$result = ereg_replace("Friday","Sexta",$result);.

$result = ereg_replace("Saturday","Sbado",$result);.

Return $result;.

}.

Id missed a few $ on the variables..

Then you need to open includes/functions/general.php and find the function tep_date_long..

At the bottom of this function replace:.

Return strftime(DATE_FORMAT_LONG, mktime($hour,$minute,$second,$month,$day,$year));.

With.

If function_exists('my_strftime') {.

   return my_strftime(DATE_FORMAT_LONG, mktime($hour,$minute,$second,$month,$day,$year));.

   } else {.

   return strftime(DATE_FORMAT_LONG, mktime($hour,$minute,$second,$month,$day,$year));.

   }.

Then if you define your locale as english in your portugese.php then it will work. The other languages will call the ordinary strftime...

Comment #5

That should be.

If (function_exists('my_strftime')) {.

   return my_strftime(DATE_FORMAT_LONG, mktime($hour,$minute,$second,$month,$day,$year));.

   } else {.

   return strftime(DATE_FORMAT_LONG, mktime($hour,$minute,$second,$month,$day,$year));.

   }..

Comment #6

Hey, thanks guys, know in the product info show "Este produto est em nosso catlogo desde Sexta 25 Julho, 2003." hehe.

And, I don't want to be those guys who ask everything, but I tryied to translate the date in the footer and the "requests since" in the right side of the footer and I have no success... any ideia?..

Comment #7

This is because they call strftime directly here.

If you change.

Echo strftime(DATE_FORMAT_LONG); ?>.

To.

If (function_exists('my_strftime')) {.

    echo my_strftime(DATE_FORMAT_LONG); ?>.

} else {.

    echo strftime(DATE_FORMAT_LONG); ?>.

}.

And then do something similar for the strftime reference in includes/counter.php that will sort those out..

Comment #8

Thanks meltus!!! I maked some changes and now it work!..

Comment #9

Hi guys... I am kinda new to PHP... so will post a stupid quetion....

Where am I supposed to write this function for my language?..

Comment #10

My_strftime? I would put it in includes/functions/general.php.

Echo strftime(DATE_FORMAT_LONG); is in includes/footer.php.

Hth,.

Matt..

Comment #11

I did what I could but still not working properly!.

I did everything I read about in this topic..

What I have as a result is working counter on the right side of the footer….

And something very strange on the left….

I got the message:.

Warning: Missing argument 2 for my_strftime() in /home/digiteq/pub/www.digiteq.com/cat/includes/functions/general.php on line 1263.

Четвъртък, 01 Януари 1970.

And that date corresponds to the English -> January 01, 1970.

On that 1263th line is the beginning of the definition of function my_strftime.

Function my_strftime($format, $time_stamp) {.

And the problem according to me is from the line in the footer ->.

Echo my_strftime(DATE_FORMAT_LONG);.

Has just one argument..

I tried to give it the second argument but no better result..

The strange thing is that the date is in Bulgarian all over the store but in the footer and in “Нови продукти за November”, which is “New products for November”.

I would appreciate if someone can help me with that….

Thanx...

Comment #12

I've readed all this post, I followed all the steps, and got no errors. But dates are still in English, what's wrong?.

What should I put in 'setlocale' for getting the my_strftime working?..

Comment #13

Finally I got it working..

But now the month in 'New products in ...' remain in English..

The file index.php shows:.

How can I change '%s' to show the month in my language?..

Comment #14

Well, I have tried it all and still nothing... the dates are still in english....

Can anyone put here the exact code (copy/paste) with the modifications or send the 2 files by e-mail?.

Thanks!..

Comment #15

If you have the language in usr/share/locale, the simplest trick is this:.

Cumprimentos:.

Nuno Luz..

Comment #16


This question was taken from a support group/message board and re-posted here so others can learn from it.