Jump to content

get foreign dday names with date() function


Dragen

Recommended Posts

I'm using the date function to echo out days of the week, which is extremely simple to do.

But I'm working on a multi-language site where the user can choose their preffered language. I've sorted that part.

 

The only thing I'm wondering about is, can I use the date() function to output foreign dates?

so instead of echoing:

monday, tuesday, wednesday

it will echo something like:

lundi, mardi, mercredi

for a french viewer..

 

I suppose I could link it in with an array od days for each language, but it would simpler if ther was perhaps a foreign date() function of some sort.

Any ideas?

Link to comment
Share on other sites

no, I'm not using google. I've got a language system I've built in, where a user can select the language and all pages then read the correct text from the language file.

I could easily list the days in each language in each file and write a function to do it, just thought it'd be easier if there was already a function to do it that I hadn't come across.

Link to comment
Share on other sites

Yeah I had thought of doing it by ip, but looking into it it seems quite unreliable. Many ip addresses seem to be from another planet...

I know my ip address is located a very long way away from where I am, although still in the same country I think.

 

I'd also thought of doing by reading the language that the browser is set too, but thought it would be simpler just to have it by a little button to click.

Link to comment
Share on other sites

Yeah, I'm using flags :D

What use would different css styles be for languages?

I'm using different files which define constants that are used on the pages, such as

define('SOMECONTENT', 'hello, this is some random gibberish');

defining it differently depending on which language file has been collected.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.