HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


How to get dates and times in local format?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#57935 (In Topic #12649)
Avatar

Fan in action

After succesful installation of Dutch translations, my site still gives dates and times in English format. How can I change that? Do I have to set some 'locale' parameter somewhere?
Back to the top
 
Posted
Rating:
#57941
Avatar

Hi,

These are controlled by some language strings. More details are in our internationalisation tutorial.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#57952
Avatar

Fan in action

After reading the tutorial I'm afraid I didn't handle the locale-codes right for the Dutch translations.
If I'm not mistaken, they are concentrated in the "global"-template, where the following items appear:

10. English: . Explanation: A comma-separated list of locale codes, given in priority (different systems have different availability, and convention)
Located in [descriptions]locale
18. en-GB
Located in [strings]locale
19. en-GB
Located in [strings]dictionary  

Probably, I didn't handle these right, when I 'translated' these as follows:
10. "nl,en"
18. "en-GB"
19. "en-GB"
I guess for 18 and 19 it should be: "nl". For 10, I'm not sure yet. I'll try and report back.
Back to the top
 
Posted
Rating:
#57954
Avatar

Fan in action

O.k. for 18 and 19, the following works:
"nl-NL,nl_NL,nld-NLD,nld_NLD".

I don't quite understand what string nr. 10 does. Chris, could you explain?

Now I see that time-notation is not correct anymore (it tries to give times in a more Dutch way, that is, without "AM" of "PM", but it shouldn't just leave those out. Instead it should distinguish between 8.00 o'clock and 20.00 o'clock). I'll try to correct that.
 
Back to the top
 
Posted
Rating:
#57956
Avatar

Anything that says it is located in [descriptions] should be ignored. It's a side effect from the third party tool we use to import into Launchpad, where that tool is converting our comments into actual translatable entries.

date_* / time_* / calendar_* is the bit in the tutorial I was referring to. But actually Launchpad will be referring to these according to what the original English versions were, rather than the codenames; look for strings like "%i:%M %p".


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#57958
Avatar

Fan in action

O.k. I've stumbled around in the PHP manual for date and time parameters that are appropriate for my language. I think I found them (at least they seem to work now on my site) and updated the Launchpad translations.

Anyone interested in how to do this, can take a look at Launchpad (template global for Dutch language).

One more thing: posts on my site tend to show a time which is one hour before 'realtime' over here. When looking how to correct this, I noticed that in the 'global' template, there is a string "date_verbose_time" with the following explanation: "English: %i:%M %p. Explanation: Note that if you're running an international site, you might want to put your timezone on here and related time strings". My question: how could I put my timezone here? I've been checking the internationalisation manual and the PHP manual, but I cannot figure it out. Could someone give me an example for this (preferably for my timezone, i.e. Amsterdam)?

Thanks as always,
Frits
Back to the top
 
Posted
Rating:
#57959
Avatar

Fan in action

Sorry, just found a way to correct the timezone by another way:

Admin Zone - Setup - Site Options - Current time.

Terrific!

Frits
Back to the top
 
Posted
Rating:
#57960
Avatar

Fan in action

The devil is in the detail: I can't get the comma between dates and times to be followed by a space. When I 'translate' the original string ", " (located in [strings]date_regular_joiner) by also ", " [with a space], this space never makes it to my site. So I need a hard space, I guess…

Anyone know how to make a hard space at Launchpad?
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: