ametaireau/pelican — Issue #213: Language based LOCALE like DATE_FORMATS
Author: farseerfc
Created: 2012-02-25 10:07:32+00:00
State: open

Hello everyone,

I am trying my own blog yesterday using Pelican, it is wonderful, especially Translation support.

http://farseerfc.github.com/

I am planning to publish my own blog using three languages mainly: English, Japanese, Chinese. Data formats works
great but it will be more wonderful if I can change LOCALE setting according to language of current page.

For example, Saturday in Japanese is 土曜日 or 土 (when using %a in date_formats) and in Chinese its 周六 or 六(%a). I want to show 2012年2月25日(土) when page is Japanese or "Sat, 25 Feb 2012" when it is English.

All I can do currently is:

```python
DATE_FORMATS = {
'en':'%a, %d %b %Y',
'zh':'%Y年%b月%d日, 周%a',
'jp':'%Y年%b月%d日(%a)',
}

# windows locale: http://msdn.microsoft.com/en-us/library/cdax410z%28VS.71%29.aspx
LOCALE = ['chn', 'jpn','usa', # windows
'en_US', 'zh_CN', 'ja_JP'] # Unix/Linux
```

But what I wants to achieve is:

```python
DATE_FORMATS = {
'en':'%a, %d %b %Y',
'zh':'%Y年%b月%d日, 周%a',
'jp':'%Y年%b月%d日(%a)',
}

# windows locale: http://msdn.microsoft.com/en-us/library/cdax410z%28VS.71%29.aspx
LOCALE = {'zh':'chn','jp':'jpn','en':'usa'} # windows
LOCALE = { 'en':'en_US', 'zh':'zh_CN', 'jp':'ja_JP'] # Unix/Linux
```

or just combine LOCALE and DATE_FORMATS together:
```python
DATE_FORMATS = {
'en':('usa', '%a, %d %b %Y'),
'zh':('chn', '%Y年%b月%d日, 周%a'),
'jp':('jpn', '%Y年%b月%d日(%a)'),
}
```

Does anyone here knows how to get this result?

Thank you.