You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Charles Moulliard <cm...@gmail.com> on 2010/11/03 07:21:33 UTC

Karaf WebConsole - I10n

Hi,

The Apache Karaf WebConsole project provides bundles_xx.properties file
to allow to translate WebConsole instructions/menu/sub-menu .... I
translate the existing file to provide French traduction. The Karaf web
console project does not provide any translation file. It should be
interesting to have it.

Can someone tell me how we can add OSGI-INF.I10N in web console of
features/gogo/admin and branding ?

Regards,

Charles


Re: Karaf WebConsole - I10n

Posted by Charles Moulliard <cm...@gmail.com>.
The bundles features, gogo, admin and branding of Karaf WebConsole are 
different from those of Apache Felix WebConsole. They don't use html 
pages. html is hardcoded in javascript function.

ex :

function renderView() {
     renderStatusLine();
     renderTable( "Feature Repositories", "repository_table", ["Name", 
"URL", "Actions"] );
     var txt = "<form method='post'><div class='table'><table 
id='repository_table_footer' class='tablelayout'><tbody>" +
         "<tr><input type='hidden' name='action' value='addRepository'/>" +
         "<td><input id='url' type='text' name='url' style='width:100%' 
colspan='2'/></td>" +
         "<td class='col_Actions'><input type='button' value='Add URL' 
onclick='addRepositoryUrl()'/></td>" +
         "</tr></tbody></table></div></form><br/>";
     $("#plugin_content").append( txt );
     renderTable( "Features", "feature_table", ["Name", "Version", 
"Repository", "Status", "Actions"] );
     renderStatusLine();
}

Question : Is it possible in javascript function to have access to 
properties of OSGI-INF/l10n/bundles.properties files ?

On 03/11/10 07:45, Lars Heinemann wrote:
> Charles,
>
> this is how it works with Eclipse Plugins (and therefore should also work for you).
>
> Usually it's enough to bundle a folder called OSGI-INF/l10n which contains the bundle.properties files where:
>
> bundle.properties - provides the default language
>
> bundle_xx.properties - provides the language for a given language ISO abbreviation (for example bundle_en.properties for English)
>
> bundle_xx_YY.properties - provides a country specific translation (for example bundle_de_AT.properties for German in Austria)
>
> If you stay with the default position of the bundle properties in OSGI-INF/l10n you don't need to worry about editing the manifest. If you
> placed the translations somewhere else in the bundle you need to point to it inside the manifest file as "Bundle-Localization:<folder>"
>
> Best regards,
> Lars
>
> --------------------------------------
>
> Lars Heinemann
> FuseSource
> Email: lhein@fusesource.com
> Web: http://www.fusesource.com
> Blog: http://lhein.blogspot.com
> Twitter: lhein77
>
>
>
>
>
> Am 03.11.2010 um 07:21 schrieb Charles Moulliard:
>
>> Hi,
>>
>> The Apache Karaf WebConsole project provides bundles_xx.properties file
>> to allow to translate WebConsole instructions/menu/sub-menu .... I
>> translate the existing file to provide French traduction. The Karaf web
>> console project does not provide any translation file. It should be
>> interesting to have it.
>>
>> Can someone tell me how we can add OSGI-INF.I10N in web console of
>> features/gogo/admin and branding ?
>>
>> Regards,
>>
>> Charles
>>

Re: Karaf WebConsole - I10n

Posted by Lars Heinemann <lh...@apache.org>.
Charles,

this is how it works with Eclipse Plugins (and therefore should also work for you).

Usually it's enough to bundle a folder called OSGI-INF/l10n which contains the bundle.properties files where:

bundle.properties - provides the default language

bundle_xx.properties - provides the language for a given language ISO abbreviation (for example bundle_en.properties for English)

bundle_xx_YY.properties - provides a country specific translation (for example bundle_de_AT.properties for German in Austria)

If you stay with the default position of the bundle properties in OSGI-INF/l10n you don't need to worry about editing the manifest. If you 
placed the translations somewhere else in the bundle you need to point to it inside the manifest file as "Bundle-Localization: <folder>" 

Best regards,
Lars

--------------------------------------

Lars Heinemann
FuseSource 
Email: lhein@fusesource.com
Web: http://www.fusesource.com
Blog: http://lhein.blogspot.com
Twitter: lhein77





Am 03.11.2010 um 07:21 schrieb Charles Moulliard:

> Hi,
> 
> The Apache Karaf WebConsole project provides bundles_xx.properties file
> to allow to translate WebConsole instructions/menu/sub-menu .... I
> translate the existing file to provide French traduction. The Karaf web
> console project does not provide any translation file. It should be
> interesting to have it.
> 
> Can someone tell me how we can add OSGI-INF.I10N in web console of
> features/gogo/admin and branding ?
> 
> Regards,
> 
> Charles
>