Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to localize a file that is overridden by a custom theme in ownCloud?

According to this issue in the bugtracker you can override theme files by just placing them in your own theme folder and editing them. In the case of the email templates, that are sent when you share a file with someone this looks like this:

print_unescaped($l->t("Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n", array($_['user_displayname'], $_['filename'], $_['link'])));

This relies on the localization feature, so when I change this text it will only be displayed in English, because the new text is not available in the language files.

I found localization files in <owncloud>/core/l10n/de_DE.php, which look like this:

$TRANSLATIONS = array(
"%s shared »%s« with you" => "%s hat »%s« mit Ihnen geteilt",
"Couldn't send mail to following users: %s " => "An folgende Benutzer konnte keine E-Mail gesendet werden: %s",
// ...
);

I assume that I could copy this file over to my theme directory too and add my translation for the new text, but that way I would lose future changes in the original localization file.

What I would like to have is the possibility to append (and ideally override) entries to the $TRANSLATIONS array in my theme directory.

The official documentation about theming is not up to date (it looks like it has been copied from the previous version without adapting it to changes) and does't cover localization at all. The documentation about translation is not helpful either.

share|improve this question

1 Answer 1

With the release of ownCloud 7, you can edit the e-mail templates via the admin control panel. About localisation of your text on this link it is well explained how you can generate new language files.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.