Closed GoogleCodeExporter closed 9 years ago
I looked sources and found one variant to achieve 'date localization' inside
template.
\trunk\kernel\src\main\java\org\vosao\business\impl\PageBusinessImpl.java
public VelocityContext createContext(final String languageCode) {...
line ~ 189:
.....
context.put("language", language);
context.put("locale", new Locale(language.getCode())); //!! ADD Locale to Velocity context using 'language code'
.....
Now you can tweak Velocity template like:
Change current code from:
$date.format('MMM', $page.publishDate)
to:
$date.format('MMM', $page.publishDate, $locale)
-----
from
date.format('medium_time', $page.modDate)
to
date.format('medium_time', $page.modDate, $locale)
Works fine for me. Of course that patch doesn't fix all possible cases. There
is no ability to make Locale using more then one parameter now, like
Locale("String language, String country).
Original comment by bland...@gmail.com
on 2 Nov 2010 at 12:05
This issue was closed by revision r932.
Original comment by kinyelo@gmail.com
on 26 Nov 2010 at 5:31
Original issue reported on code.google.com by
Emo...@gmail.com
on 16 Oct 2010 at 10:47