[Owncloud] Translating the Navigation entry of an app

Alessandro Cosentino cosenal at gmail.com
Thu Dec 20 22:33:19 UTC 2012


The function OC_L10N::get takes as a parameter the appid, which in
your case is 'notes_index', not 'Notes'.

Alessandro

On Thu, Dec 20, 2012 at 4:47 PM, Victor Dubiniuk
<victor.dubiniuk at gmail.com> wrote:
> Hi George,
>
> it's just a guess but I think appid should be in lowercase:
>
> $l=OC_L10N::get('notes');
>
>
>
> ---
> Victor
>
>
> On Thu, Dec 20, 2012 at 10:51 PM, George Ruinelli <george at ruinelli.ch>
> wrote:
>>
>> Hi all
>>
>> I am trying to figure out how I can provide a translated version of my
>> apps
>> name on the left side in the OwnCloud navigation.
>>
>> I created a translation file de.php in l10n which contains all needed
>> strings:
>> ------------------------------
>> <?php $TRANSLATIONS = array(
>> "Notes" => "Notizen",
>> "Add Note" => "Notiz hinzufügen",
>> ...
>> );
>>
>>
>> In appsinfo/apps.php, I have the following:
>> ------------------------------
>> <?php
>> $l=OC_L10N::get('Notes');
>>
>> OCP\App::addNavigationEntry( array(
>>   'id' => 'notes_index',
>>   'order' => 11,
>>   'href' => OCP\Util::linkTo( 'notes', 'index.php' ),
>>   'icon' => OCP\Util::imagePath( 'notes', 'icon.png' ),
>>   'name' => $l->t('Notes'))
>> );
>> ------------------------------
>>
>> The texts in the app itself get translated, how ever the apps name in the
>> navigation stays in the original language.
>> If somebody wants to test it, simply install
>> http://apps.owncloud.com/content/show.php/Notes?content=155599 and switch
>> the
>> language to German.
>>
>> Thanx for any hints
>> _______________________________________________
>> Owncloud mailing list
>> Owncloud at kde.org
>> https://mail.kde.org/mailman/listinfo/owncloud
>
>
>
> _______________________________________________
> Owncloud mailing list
> Owncloud at kde.org
> https://mail.kde.org/mailman/listinfo/owncloud
>



More information about the Owncloud mailing list