diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-10-17 19:47:37 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-10-29 10:09:12 +0100 |
commit | ec1a73fab9aa6b71b502ee45f4d0dd4f20661930 (patch) | |
tree | f60269f9999cc94b66043b8ac87ac92f9014b4ed /lib/private/template | |
parent | f67123c5a498e45a08900987b10779c7c60af601 (diff) | |
download | nextcloud-server-ec1a73fab9aa6b71b502ee45f4d0dd4f20661930.tar.gz nextcloud-server-ec1a73fab9aa6b71b502ee45f4d0dd4f20661930.zip |
Added OC.L10N namespace with translation functions
Added addTranslations and fixed de.js file
Fixed de.js to use OC.L10N.register() and use to correct expected
format.
Added JS unit tests for OC.L10N class
Include translations JS script for all apps
Diffstat (limited to 'lib/private/template')
-rw-r--r-- | lib/private/template/functions.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/template/functions.php b/lib/private/template/functions.php index cbe751e59b5..8c94b7cf345 100644 --- a/lib/private/template/functions.php +++ b/lib/private/template/functions.php @@ -56,6 +56,22 @@ function style($app, $file) { } /** + * Shortcut for adding translations to a page + * @param string $app the appname + * @param string|string[] $file the filename, + * if an array is given it will add all styles + */ +function translation($app, $file) { + if(is_array($file)) { + foreach($file as $f) { + OC_Util::addStyle($app, $f); + } + } else { + OC_Util::addStyle($app, $file); + } +} + +/** * Shortcut for HTML imports * @param string $app the appname * @param string|string[] $file the path relative to the app's component folder, |