[Yanel-dev] How should we handle translations which do not exist yet?

Josias Thöny josias.thoeny at wyona.com
Fri Apr 20 17:40:18 CEST 2007


Michael Wechner wrote:
> Josias Thöny wrote:
> 
>> Michael Wechner wrote:
>>
>>> Hi
>>>
>>> Thanks to Josias we now can configure the translation managers. 
>>> Please see for instance
>>>
>>> src/realms/yanel-website/config/yanel-realm-config.xml
>>>
>>> and in action at
>>>
>>> http://127.0.0.1:8080/yanel/yanel-website/en/download/index.html
>>>
>>> Now the german and spanish page do not exist yet and one receives a 404.
>>>
>>> I guess it would make sense that the translation manager is checking 
>>> if the translations actually exists and
>>> one can decide within the XSLT what to do about it.
>>>
>>> WDYT?
>>
>>
>> Actually it's checking for existance already. However it uses the 
>> exists() method of the resource, and not all resource types implement 
>> this method. Is there a better way to check?
> 
> 
> No I think that's the right way :-) but we should implement exists() 
> anyway, which is often my bad ;-)
> 
>> Attached is a patch for the exists() method of the NodeResource.
> 
> 
> applied,  thanks very much
> 
>> It should fix the problem, because if a resource does not exist, it's 
>> type will always fall back to the NodeResource.
>> The result is that only language links to existing language versions 
>> will be shown. Maybe in the case where only one language version 
>> exists, we shouldn't display the language link. WDYT?
> 
> 
> I guess in most cases that would be true, but for instance in the case 
> of the Yanel website it would probably be nice to list the not existing 
> translations yet with a dialog popping up and saying like, "do you want 
> to translate this page ;-)" as a hint.

Hm, for a demo website or wiki-like pages this might make sense, but for 
the live yanel website it seems a bit strange to me to have this 
feature. What do others think about it?

> 
> So I guess it would be nice that we make this customizable within the 
> XSLT translation.xsl, whereas I guess this is already the possible, right?

Actually it's not possible now, but it shouldn't be too hard to 
implement that. We could modify the TranslationResource to include all 
languages, not only the existing ones. Then the xslt can show that or 
not, depending on what people want.
Should I do that?

> 
> btw, the page
> 
> http://127.0.0.1:8080/yanel/yanel-website/en/download/index.html
> 
> does only show english now which is correct, but I guess it shouldn't 
> link to itself, right?

I guess the xslt should not display anything if there is only one 
language. That's what I mentioned in my last mail.
Or are you referring to a different problem?

Josias

> 
> Cheers
> 
> Michi
> 
>>
>> josias
>>
>>
>>>
>>> Cheers
>>>
>>> Michi
>>>
>>
>> ------------------------------------------------------------------------
>>
>> Index: 
>> src/resources/file/src/java/org/wyona/yanel/impl/resources/NodeResource.java 
>>
>> ===================================================================
>> --- 
>> src/resources/file/src/java/org/wyona/yanel/impl/resources/NodeResource.java    
>> (revision 23920)
>> +++ 
>> src/resources/file/src/java/org/wyona/yanel/impl/resources/NodeResource.java    
>> (working copy)
>> @@ -284,8 +284,7 @@
>>     }
>>
>>     public boolean exists() throws Exception {
>> -        log.warn("Not implemented yet!");
>> -        return true; +        return 
>> getRealm().getRepository().existsNode(getPath());
>>     }
>>
>>     /**
>>  
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Yanel-development mailing list
>> Yanel-development at wyona.com
>> http://wyona.com/cgi-bin/mailman/listinfo/yanel-development
>>  
>>
> 
> 




More information about the Yanel-development mailing list