[Owncloud] Translating the Navigation entry of an app

George Ruinelli george at ruinelli.ch
Thu Dec 20 19:51:33 UTC 2012


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



More information about the Owncloud mailing list