elfuchsjekyll / vosao

Automatically exported from code.google.com/p/vosao
0 stars 0 forks source link

Page title translations (multi-language support) #115

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice to have support for having title in different languages.
Example of where it is needed:
You want to list a page links with title names in the some kind of menu.
So you want to fetch titles for current selected language.
As it is now it is not possible.

Original issue reported on code.google.com by adis.kat...@gmail.com on 9 Feb 2010 at 12:42

GoogleCodeExporter commented 9 years ago
Agree CMS must have feature.

Original comment by kinyelo@gmail.com on 9 Feb 2010 at 1:22

GoogleCodeExporter commented 9 years ago
Implemented.

For current page $page.title returns english version, $page.localTitle - title 
for
current language, $page.getLocalTitle('ru') - title for Russian language.

For pages received from $service.find* available only 
$page.getLocalTitle($language)
- for current language.

Original comment by kinyelo@gmail.com on 11 Feb 2010 at 3:14

GoogleCodeExporter commented 9 years ago
This implementation has quite many drawbacks and is not really useful.
These improvements would be great to have:
1. $page.localTitle should return localTitle if translation exists otherwise 
defualt 
(english) version that is just title
2. In order to use $page.getLocalTitle($language) I need to know current 
language. I 
don't understand how to get it as it is now. So following is needed:
$page.language returns current page selected language and
$service.currentLanguage returns current selected language for the user
3. If you implement above I could use:
$service.findPage("/").getLocalTitle($page.language)
but it would be nice to be able to even simpler like
$service.findPage("/").localTitle

All of this is useful when you create dynamic links.

Original comment by adis.kat...@gmail.com on 23 Mar 2010 at 10:13

GoogleCodeExporter commented 9 years ago
Look at 
http://code.google.com/p/vosao/source/browse/tags/0.3/kernel/src/main/java/org/v
osao/
business/impl/PageBusinessImpl.java lines 177

There is $language variable available in context of type LanguageEntity

you can use: $service.findPage("/").getLocalTitle($language.code)

After fix http://code.google.com/p/vosao/source/detail?r=586 it should work as 
you 
described in (1)

Please check if all OK I will build 0.3.2 with this fix included.

Original comment by kinyelo@gmail.com on 25 Mar 2010 at 9:45

GoogleCodeExporter commented 9 years ago

Original comment by kinyelo@gmail.com on 11 Apr 2010 at 11:02