You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Philippe Guillard <pg...@citycita.net> on 2005/10/04 08:14:47 UTC

Re: Checking all keys are translated - done before ?

I need this too. I would say the easiest way is to navigate in your site 
and then see the core logs in debug mode, unfortunately i only see the 
[core.i18n-bundles] catalog resolution messages, and not the keys 
resolution...
Maybe the question could be transformed to : Is it possible to set 
logging in the i18n transformer definition?
Phil

Messing, Elad wrote:

>Hello all
>	I was wondering if anyone ever produced some code that :
>	1. Checks that all translation files consists the same keys
>(everything is translated between every language).
>	2. Checks that all the keys scattered around the cocoon files
>appear in the translation files .
>	
>	This is quite useful before producing a build - to make sure all
>translations were done.
>
>	I tried looking for this in the message archive, but couldn't
>find it - although I am quite sure someone already did it once..
>
>
>	What do you say ? 
>
>Elad Messing
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Checking all keys are translated - done before ?

Posted by Philippe Guillard <pg...@citycita.net>.
Having non existing i18n keys in the logs would be enough for my needs, 
but i can't found them.
Setting sitemap logs to debug in logkit, i get systematically this for 
reserved or unresolved keys:

DEBUG   [/portal/3dmedia/22/] I18nTransformer: Starting i18n element: text
DEBUG   [/portal/3dmedia/22/] I18nTransformer: Start i18n element: text
DEBUG   [/portal/3dmedia/22/] I18nTransformer: i18n message text = 'foo'
DEBUG   [/portal/3dmedia/22/] I18nTransformer: End i18n element: text
DEBUG   [/portal/3dmedia/22/] I18nTransformer: Getting key foo from 
catalogue null
(It says catalogue null but translation is working)

Can somebofy tell me what to do?

Phil

Joerg Heinicke wrote:

>Thomas Lutz <mattom <at> gmx.at> writes:
>
>  
>
>>Maybe it's possible to create some sort of file crawler, that applies 
>>the I18N transformer to the files when deploying ?
>>    
>>
>
>That's not possible neither. Imagine an XML that contains the i18n keys not in 
>i18n namespace, an XSLT converts them to i18n. Or even worse: only part of the 
>key is in the XML, the rest is added by the XSLT. You will never get a fully 
>working crawler except by crawling *all* pipelines with every possible 
>request. For me this sounds like a task for an automated test where you can 
>grep the log files afterwards.
>
>Jörg
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Checking all keys are translated - done before ?

Posted by Joerg Heinicke <jo...@gmx.de>.
Thomas Lutz <mattom <at> gmx.at> writes:

> Maybe it's possible to create some sort of file crawler, that applies 
> the I18N transformer to the files when deploying ?

That's not possible neither. Imagine an XML that contains the i18n keys not in 
i18n namespace, an XSLT converts them to i18n. Or even worse: only part of the 
key is in the XML, the rest is added by the XSLT. You will never get a fully 
working crawler except by crawling *all* pipelines with every possible 
request. For me this sounds like a task for an automated test where you can 
grep the log files afterwards.

Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Checking all keys are translated - done before ?

Posted by Thomas Lutz <ma...@gmx.at>.
<snip />

>>Well, I'll need this soon :-). I was thinking of some sort of grep
>>shellscript stuff, but this could be achieved with some java classes
>>using regular expressions too.
>>    
>>
>
>here you get a problem with regex when you have sth. like this:
><input type="submit" name="myname" value="mykey" i18n:attr="value" />
>
>Best would be to enable I18N Transformer to log the missing translations.
>
>The transformer logs (warn) untranslated keys:
>
>---snip---
>getLogger().warn("Translation not found for attribute " +
>name + " in element <" + element + ">");
>---snap---
>  
>
<snip />

Hm, yep, you're right. Still I don't like the idea of not being able to 
detect those problems at deploy time...

Maybe it's possible to create some sort of file crawler, that applies 
the I18N transformer to the files when deploying ?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Checking all keys are translated - done before ?

Posted by Christoph Hermann <ch...@guschtel.de>.
Thomas Lutz schrieb:

Hello,

>> [Checking for untranslated keys]

> Well, I'll need this soon :-). I was thinking of some sort of grep
> shellscript stuff, but this could be achieved with some java classes
> using regular expressions too.

here you get a problem with regex when you have sth. like this:
<input type="submit" name="myname" value="mykey" i18n:attr="value" />

Best would be to enable I18N Transformer to log the missing translations.

The transformer logs (warn) untranslated keys:

---snip---
getLogger().warn("Translation not found for attribute " +
name + " in element <" + element + ">");
---snap---

HTH
Christoph

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Checking all keys are translated - done before ?

Posted by Thomas Lutz <ma...@gmx.at>.
Philippe Guillard wrote:

> I need this too. I would say the easiest way is to navigate in your 
> site and then see the core logs in debug mode, unfortunately i only 
> see the [core.i18n-bundles] catalog resolution messages, and not the 
> keys resolution...
> Maybe the question could be transformed to : Is it possible to set 
> logging in the i18n transformer definition?
> Phil
>
<snip />

Well, I'll need this soon :-). I was thinking of some sort of grep 
shellscript stuff, but this could be achieved with some java classes 
using regular expressions too.
IMO it's not the best solution to have to check for missing translations 
at runtime. You'd have to have unit tests for your whole webapp...

regards,
tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org