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.