Minor changes on locales.

stable
Andrey Antukh 2014-06-18 14:55:04 +02:00
parent de23dae404
commit c2ac5c0d9e
4 changed files with 24 additions and 8 deletions

View File

@ -56,6 +56,7 @@ modules = [
"taigaConfig", "taigaConfig",
"taigaBase", "taigaBase",
"taigaResources", "taigaResources",
"taigaLocales",
# Specific Modules # Specific Modules
"taigaBacklog", "taigaBacklog",

View File

@ -29,8 +29,7 @@ defaults = {
} }
class I18nService extends taiga.TaigaService class I18nService extends taiga.Service
@.$inject = ["$rootScope", "localeEnglish"]
constructor: (@rootscope, @localeEn) -> constructor: (@rootscope, @localeEn) ->
setLanguage: (language) -> setLanguage: (language) ->
@ -46,6 +45,7 @@ class I18nService extends taiga.TaigaService
options.resStore = { options.resStore = {
en: { app: @localeEn } en: { app: @localeEn }
} }
i18n.init(options) i18n.init(options)
@rootscope.t = i18n.t @rootscope.t = i18n.t
@ -60,17 +60,17 @@ I18nDirective = ($rootscope, $i18n) ->
for v in values for v in values
if v.indexOf(":") == -1 if v.indexOf(":") == -1
element.html($scope.t(v, opts)) $el.html($scope.t(v, opts))
else else
[ns, v] = v.split(":") [ns, v] = v.split(":")
element.attr(ns, $scope.t(v, opts)) $el.attr(ns, $scope.t(v, opts))
bindOnce(scope, "t", applyTranslation) bindOnce($scope, "t", applyTranslation)
$scope.$on("i18n:changeLang", applyTranslation) $scope.$on("i18n:changeLang", applyTranslation)
return {link: link} return {link: link}
module = angular.module("taigaBase") module = angular.module("taigaBase")
module.service("$tgI18n", ["$rootScope", I18nService]) module.service("$tgI18n", ["$rootScope", "localesEnglish", I18nService])
module.directive("tgI18n", ["$rootScope", "$tgI18n", I18nDirective]) module.directive("tgI18n", ["$rootScope", "$tgI18n", I18nDirective])

View File

@ -27,5 +27,19 @@
"pagination": { "pagination": {
"next": "Next", "next": "Next",
"prev": "Previous" "prev": "Previous"
},
"common": {
"subject": "Subject"
"save": "Save",
"blocked": "Blocked",
"cancel": "Cancel",
"status": "Status",
"new-bulk": "New bulk insert",
"one-item-line": "One item per line..."
},
"us": {
"title-new": "New User Story",
"team-requirement": "Ream Requirement",
"client-requirement": "Client Requirement"
} }
} }

View File

@ -36,10 +36,11 @@ paths = {
coffee: ["app/coffee/app.coffee", coffee: ["app/coffee/app.coffee",
"config/main.coffee", "config/main.coffee",
"app/coffee/*.coffee", "app/coffee/*.coffee",
"app/coffee/modules/controllerMixins.coffee",
"app/coffee/modules/*.coffee", "app/coffee/modules/*.coffee",
"app/coffee/modules/locales/*.coffee",
"app/coffee/modules/base/*.coffee", "app/coffee/modules/base/*.coffee",
"app/coffee/modules/resources/*.coffee", "app/coffee/modules/resources/*.coffee"]
"app/coffee/**/*.coffee"]
} }