views:

269

answers:

2

I'm adding additional languages to a Drupal site that I'm building.

Getting the translation of content working is fairly easy using the Internationalisation module.

Yet, simple things such as date strings, i.e. day, month and year aren't translated.

I would expect simple things like this to be some of the first things to be translated.

Am I missing something?

+1  A: 

For text to be translated, each module needs to pass display text through a specific function (named 't()') which allows the text to be translatable.

It's probably likely that some module writers are better at doing this consistently than others.

codeinthehole
So, for example, on the default content type 'Story' if I create one and publish it you see 'Mon, 11/16/2009 - 23:21' displayed. If I want to translate the 'Mon' in that what do I have to do?
Ben
I think this might be a special case. AFAIK the date settings are defined in the Date and Time settings part of the admin interface (/admin/settings/date-time/) - and these are based on standard PHP date formats. You can define custom formats - defining a specific format for the language you're translating to might be the best route to follow.
codeinthehole
Actually - an alternative would be to use a custom template for your content type. You can then wrap the date output in a 't()' function yourself, allowing the days to be translated in the usual manner using the internationalisation module.
codeinthehole
Excellent, thanks!
Ben
A: 

I found the solution to this in the end.

It came down to knowing what to search for in the translate interface admin section.

I was looking to translate month names into different languages and so search for strings matching 'November'. This always came up with nothing.

It truned out that I need to search for 'month'. This then allowed my to add translations for all of the month names and also other date related translations.

Very frustrating the effort required to find that out!

Ben

related questions