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

Michael Wechner michael.wechner at wyona.com
Fri Apr 20 17:03:46 CEST 2007


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.

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?

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?

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
>  
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner at wyona.com                        michi at apache.org
+41 44 272 91 61




More information about the Yanel-development mailing list