On Sat, Feb 18, 2012 at 3:59 PM, <[email protected]> wrote: > Done! Thanks for your help! Please, see below! > -- > Ricardo Rodríguez > Research Management and Promotion Technician > Health Research Institute of Santiago de Compostela (IDIS) > http://www.idisantiago.es > ________________________________________ > From: [email protected] [[email protected]] On Behalf Of > Rodriguez Fernandez, Ricardo Julio > Sent: 18 February 2012 00:40 > To: [email protected] > Subject: Re: [xwiki-users] getting translated title > > HI! Please, see below. Thanks! > ________________________________________ > From: [email protected] [[email protected]] On Behalf Of > Rodriguez Fernandez, Ricardo Julio > Sent: 17 February 2012 23:56 > To: [email protected] > Subject: Re: [xwiki-users] getting translated title > >>>>>> Thanks, Marius. Please, see below. > > ________________________________________ > From: [email protected] [[email protected]] On Behalf Of Marius > Dumitru Florea [[email protected]] > Sent: 17 February 2012 18:07 > To: XWiki Users > Subject: Re: [xwiki-users] getting translated title > > On Fri, Feb 17, 2012 at 6:05 PM, > <[email protected]> wrote: >> Hi! >> _________________ >>>> From: [email protected] [[email protected]] On Behalf Of >>>> Marius Dumitru Florea [[email protected]] >>>> Sent: 17 February 2012 08:30 >>>> To: XWiki Users >>>> Subject: Re: [xwiki-users] getting translated title >> >>>> Hi Ricardo, >> >> On Fri, Feb 17, 2012 at 2:35 AM, >> <[email protected]> wrote: >>> Hello, >>> >>> Please, how could I get the title of a translated document to be used in a >>> Velocity script? Please, see an example: >>> >>> http://atrium_km.idisantiago.es/bin/XWiki/XWikiIDISAreaEndocrinology >>> >>> Whatever language I select, group names are already show in Spanish even >>> though group names exist in all three languages. For instance... >>> >>> atrium_km.idisantiago.es/bin/XWiki/XWikiIDISC01 >> >>>> I don't see the problem. For both groups, XWikiIDISAreaEndocrinology >>>> and XWikiIDISC01, the title changes when I change the language from >>>> the top right corner, below the search box. For >>>> XWikiIDISAreaEndocrinology I get: Endocrinology (en), Endocrinología >>>> (es) and Endocrinoloxía (gl). What exactly are you trying to achieve? >>>> >>>> Hope this helps, >>>> Marius >> >> Yeap, no problem with this page: it shows the right title once you select >> any of the three languages. BUT the name of the members appears always in >> Spanish (at least here) even though there are translations for all three >> languages. For instance, check this group... >> >> http://atrium_km.idisantiago.es/bin/XWiki/XWikiIDISC08?language=es >> http://atrium_km.idisantiago.es/bin/XWiki/XWikiIDISC08?language=gl >> http://atrium_km.idisantiago.es/bin/XWiki/XWikiIDISC08?language=en >> >> This group is included in the meta-group XWikiIDISAreaEndocrinology... >> >> http://atrium_km.idisantiago.es/bin/XWiki/XWikiIDISAreaEndocrinology >> >> But this page, the one showing all members of this area, shows its name >> always in Spanish (at least here) even though I use the language switch... >> >> http://atrium_km.idisantiago.es/bin/XWiki/XWikiIDISAreaEndocrinology?language=es >> http://atrium_km.idisantiago.es/bin/XWiki/XWikiIDISAreaEndocrinology?language=gl >> http://atrium_km.idisantiago.es/bin/XWiki/XWikiIDISAreaEndocrinology?language=en >> >> It is clear to me that the language switch affects only the contents of the >> "main document" (in this case, XWiki/XWikiIDISAreaEndocrinology) and doesn't >> determine what translation of each area is shown. >> >> I've modified /templates/getgroupmembers.vm (XWiki Enterprise 2.4.30451) >> this way... >> > >> "member" : "$mdoc.title #if($hasAdmin || $isAdvancedUser) >> (#if($wikiname != 'local')$wikiname:#end$m)#end", > >>>>> You could try to use >>>>> >>>>> $mdoc.translatedDocument.title >>>>> >>>>> or, if the language is not properly set on the XWiki context, >>>>> >>>>> $mdoc.getTranslatedDocument($language).title >>>>> >>>>> but for this you need to take the language from somewhere, a request >>>>> parameter probably. >>>>> >>>>> Hope this helps, >>>>> Marius > >>>>>> Thanks, Marius. Neither of these solutions did work. Please, could you >>>>>> point me in the right direction to find some materials to go through >>>>>> your proposal stated by "a request paremeter probably"? >>>>>> >>>>>> I'm lost with this issue. Please, chech this: >>>>>> >>>>>> http://atrium_km.idisantiago.es/bin/XWiki/XWikiIDISAreaEndocrinology >>>>>> >>>>>> getgroupmembers.vm reads this way now... >>>>>> >>>>>> "member" : "$mdoc.title **$context.language** #if($hasAdmin || >>>>>> $isAdvancedUser) (#if($wikiname != 'local')$wikiname:#end$m)#end", >>>>>> >>>>>> Whatever language I select, I always read **en** in the output. Please, >>>>>> do you know why? Where am I wrong? Titles in Spanich, context language >>>>>> set to English... I'm truly lost... >>>>>> >>>>>> Thanks for your help! >>>>>> >>>>>> Best, >>>>>> >>>>>> Ricardo > >>>>>>> Some more, probably obvious, information on this issue: >>>>>>> >>>>>>> 1. **en** is the default language of XWiki.XWikiIDISAreaEndocrinology. >>>>>>> 2. **es** is the default language of all and every group having >>>>>>> XWiki.XWikiIDISAreaEndocrinology as parent. >>>>>>> >>>>>>> I guess that the clue of this issue must be how to store the language >>>>>>> of each iteration and store it to presente it with some infortmation on >>>>>>> this issue! >>>>>>> >>>>>>> Any idea will be exremely welome! >>>>>>> >>>>>>> Thaks! > > As stated by Marius before, getTranslatedDocument did the job... but this way: > > "member" : "$mdoc.getTranslatedDocument().title #if($hasAdmin || > $isAdvancedUser) (#if($wikiname != 'local')$wikiname:#end$m)#end", > > I tried before with getTranslatedDocument($language) and didn't work. I guess > the reason is that $language is not set and getTranslatedDocument() looks for > it in the order specified in Javadoc here... > > http://tinyurl.com/754khmh >
> Isn't it? Yes. My suggestion was to try getTranslatedDocument() first and only if it didn't work to use getTranslatedDocument($language), where $language is a variable you were suppose to define. I'm glad it worked in the end, Marius > > Thanks for your help!!! > > Ricardo > > >> >> I'm using $mdoc.title to show the title of each document instead of >> $xwiki.getUserName($m, false). getUserName works fine of members of the >> group are users, but it simply shows the name of the XWiki document when >> group members are other groups. >> >> What I'm looking for is the way of "telling" getgroupmembers.vm that it must >> show the title of a given document in the selected language. >> >> I hope I've been clearer now and this issue is not only some more noise!!!! >> >> Thanks you so much for your time and your help! >> >> Ricardo >> >> >>> >>> Thanks for your help! >>> >>> Ricardo >>> >>> -- >>> Ricardo Rodríguez >>> Research Management and Promotion Technician >>> Health Research Institute of Santiago de Compostela (IDIS) >>> http://www.idisantiago.es >>> >>> Nota: A información contida nesta mensaxe e os seus posibles documentos >>> adxuntos é privada e confidencial e está dirixida únicamente ó seu >>> destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, >>> por favor elimínea. A distribución ou copia desta mensaxe non está >>> autorizada. >>> >>> Nota: La información contenida en este mensaje y sus posibles documentos >>> adjuntos es privada y confidencial y está dirigida únicamente a su >>> destinatario/a. Si usted no es el/la destinatario/a original de este >>> mensaje, por favor elimínelo. La distribución o copia de este mensaje no >>> está autorizada. >>> >>> See more languages: http://www.sergas.es/aviso_confidencialidad.htm >>> _______________________________________________ >>> users mailing list >>> [email protected] >>> http://lists.xwiki.org/mailman/listinfo/users >> _______________________________________________ >> users mailing list >> [email protected] >> http://lists.xwiki.org/mailman/listinfo/users >> >> Nota: A información contida nesta mensaxe e os seus posibles documentos >> adxuntos é privada e confidencial e está dirixida únicamente ó seu >> destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, >> por favor elimínea. A distribución ou copia desta mensaxe non está >> autorizada. >> >> Nota: La información contenida en este mensaje y sus posibles documentos >> adjuntos es privada y confidencial y está dirigida únicamente a su >> destinatario/a. Si usted no es el/la destinatario/a original de este >> mensaje, por favor elimínelo. La distribución o copia de este mensaje no >> está autorizada. >> >> See more languages: http://www.sergas.es/aviso_confidencialidad.htm >> _______________________________________________ >> users mailing list >> [email protected] >> http://lists.xwiki.org/mailman/listinfo/users > _______________________________________________ > users mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/users > > Nota: A información contida nesta mensaxe e os seus posibles documentos > adxuntos é privada e confidencial e está dirixida únicamente ó seu > destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, > por favor elimínea. A distribución ou copia desta mensaxe non está autorizada. > > Nota: La información contenida en este mensaje y sus posibles documentos > adjuntos es privada y confidencial y está dirigida únicamente a su > destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, > por favor elimínelo. La distribución o copia de este mensaje no está > autorizada. > > See more languages: http://www.sergas.es/aviso_confidencialidad.htm > _______________________________________________ > users mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/users > > Nota: A información contida nesta mensaxe e os seus posibles documentos > adxuntos é privada e confidencial e está dirixida únicamente ó seu > destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, > por favor elimínea. A distribución ou copia desta mensaxe non está autorizada. > > Nota: La información contenida en este mensaje y sus posibles documentos > adjuntos es privada y confidencial y está dirigida únicamente a su > destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, > por favor elimínelo. La distribución o copia de este mensaje no está > autorizada. > > See more languages: http://www.sergas.es/aviso_confidencialidad.htm > _______________________________________________ > users mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/users > > Nota: A información contida nesta mensaxe e os seus posibles documentos > adxuntos é privada e confidencial e está dirixida únicamente ó seu > destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, > por favor elimínea. A distribución ou copia desta mensaxe non está autorizada. > > Nota: La información contenida en este mensaje y sus posibles documentos > adjuntos es privada y confidencial y está dirigida únicamente a su > destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, > por favor elimínelo. La distribución o copia de este mensaje no está > autorizada. > > See more languages: http://www.sergas.es/aviso_confidencialidad.htm > _______________________________________________ > users mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/users _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
