diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-09-16 17:39:32 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-09-16 17:39:32 +0200 |
commit | 2937a633de8f54d0f5f20f8ced6e8914da40d312 (patch) | |
tree | faf12c9d5e837e2c3e9e50388a6d60e1071b05d7 /js/app | |
parent | b36134664907e195278ab73c5afc0f42e7918df6 (diff) |
also translate title, fix #350
Diffstat (limited to 'js/app')
-rw-r--r-- | js/app/controllers/feedcontroller.coffee | 4 | ||||
-rw-r--r-- | js/app/directives/translate.coffee | 32 |
2 files changed, 34 insertions, 2 deletions
diff --git a/js/app/controllers/feedcontroller.coffee b/js/app/controllers/feedcontroller.coffee index 415072579..07fb22238 100644 --- a/js/app/controllers/feedcontroller.coffee +++ b/js/app/controllers/feedcontroller.coffee @@ -56,9 +56,9 @@ ActiveFeed, FeedType, $window) -> # and it has nothing to do with the body structure if count > 0 titleCount = @_unreadCountFormatter(count) - title = 'News (' + titleCount + ') | ownCloud' + title = @_$scope.translations.appName + ' (' + titleCount + ') | ownCloud' else - title = 'News | ownCloud' + title = @_$scope.translations.appName + ' | ownCloud' # only update title when it changed to prevent highlighting the # tab diff --git a/js/app/directives/translate.coffee b/js/app/directives/translate.coffee new file mode 100644 index 000000000..c3e2dfd47 --- /dev/null +++ b/js/app/directives/translate.coffee @@ -0,0 +1,32 @@ +### + +ownCloud - News + +@author Bernhard Posselt +@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +License as published by the Free Software Foundation; either +version 3 of the License, or any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU AFFERO GENERAL PUBLIC LICENSE for more details. + +You should have received a copy of the GNU Affero General Public +License along with this library. If not, see <http://www.gnu.org/licenses/>. + +### + + +# Binds translated values to scope and hides the element +angular.module('News').directive 'newsTranslate', -> + directive = + restrict: 'E' + link: (scope, element, attributes) -> + $element = $(element) + scope.translations or= scope.translations + scope.translations[attributes.key] = $element.text() + $element.remove() |