[i18n] Checksley

stable
David Barragán Merino 2015-05-13 15:12:58 +02:00
parent 9be91aaa98
commit 0d42ab9aef
8 changed files with 192 additions and 4 deletions

View File

@ -235,6 +235,7 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
if localStorage.userInfo
userInfo = JSON.parse(localStorage.userInfo)
# i18n
preferedLangCode = userInfo?.lang || window.taigaConfig.defaultLanguage || "en"
$translateProvider
@ -253,16 +254,54 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
init = ($log, $config, $rootscope, $auth, $events, $analytics, $translate) ->
$log.debug("Initialize application")
# Taiga Plugins
$rootscope.contribPlugins = @.taigaContribPlugins
$rootscope.adminPlugins = _.where(@.taigaContribPlugins, {"type": "admin"})
# i18n
$rootscope.$on "$translateChangeEnd", (ctx) ->
lang = ctx.language
# i18n - moment.js
moment.locale(lang)
# i18n - checksley.js
messages = {
defaultMessage: $translate.instant("COMMON.FORM_ERRORS.DEFAULT_MESSAGE")
type: {
email: $translate.instant("COMMON.FORM_ERRORS.TYPE_EMAIL")
url: $translate.instant("COMMON.FORM_ERRORS.TYPE_URL")
urlstrict: $translate.instant("COMMON.FORM_ERRORS.TYPE_URLSTRICT")
number: $translate.instant("COMMON.FORM_ERRORS.TYPE_NUMBER")
digits: $translate.instant("COMMON.FORM_ERRORS.TYPE_DIGITS")
dateIso: $translate.instant("COMMON.FORM_ERRORS.TYPE_DATEISO")
alphanum: $translate.instant("COMMON.FORM_ERRORS.TYPE_ALPHANUM")
phone: $translate.instant("COMMON.FORM_ERRORS.TYPE_PHONE")
}
notnull: $translate.instant("COMMON.FORM_ERRORS.NOTNULL")
notblank: $translate.instant("COMMON.FORM_ERRORS.NOT_BLANK")
required: $translate.instant("COMMON.FORM_ERRORS.REQUIRED")
regexp: $translate.instant("COMMON.FORM_ERRORS.REGEXP")
min: $translate.instant("COMMON.FORM_ERRORS.MIN")
max: $translate.instant("COMMON.FORM_ERRORS.MAX")
range: $translate.instant("COMMON.FORM_ERRORS.RANGE")
minlength: $translate.instant("COMMON.FORM_ERRORS.MIN_LENGTH")
maxlength: $translate.instant("COMMON.FORM_ERRORS.MAX_LENGTH")
rangelength: $translate.instant("COMMON.FORM_ERRORS.RANGE_LENGTH")
mincheck: $translate.instant("COMMON.FORM_ERRORS.MIN_CHECK")
maxcheck: $translate.instant("COMMON.FORM_ERRORS.MAX_CHECK")
rangecheck: $translate.instant("COMMON.FORM_ERRORS.RANGE_CHECK")
equalto: $translate.instant("COMMON.FORM_ERRORS.EQUAL_TO")
}
checksley.updateMessages('default', messages)
# Load user
if $auth.isAuthenticated()
$events.setupConnection()
user = $auth.getUser()
$translate.use(user.lang) if user.lang
# Analytics
$analytics.initialize()

View File

@ -44,7 +44,6 @@ class AuthService extends taiga.Service
_setLocales: ->
lang = @rootscope.user.lang || @config.get("defaultLanguage") || "en"
@translate.use(lang)
moment.locale(lang)
getUser: ->
if @rootscope.user

View File

@ -36,6 +36,31 @@
"EXTERNAL_USER": "un usuari extern",
"GENERIC_ERROR": "Un Oompa Loompas diu {{error}}.",
"IOCAINE_TEXT": "Un poc saturat per una tasca? Fes-ho saber als teus companys clicant a Iocaina quan edites la tasca. Es possible ser inmune a aquesta (fictícia) poció mortal consumint xicotetes dòsis poc a poc, així com es possible millorar amb xicotets nous desafiaments!",
"FORM_ERRORS": {
"DEFAULT_MESSAGE": "This value seems to be invalid.",
"TYPE_EMAIL": "This value should be a valid email.",
"TYPE_URL": "This value should be a valid url.",
"TYPE_URLSTRICT": "This value should be a valid url.",
"TYPE_NUMBER": "This value should be a valid number.",
"TYPE_DIGITS": "This value should be digits.",
"TYPE_DATEISO": "This value should be a valid date (YYYY-MM-DD).",
"TYPE_ALPHANUM": "This value should be alphanumeric.",
"TYPE_PHONE": "This value should be a valid phone number.",
"NOTNULL": "This value should not be null.",
"NOT_BLANK": "This value should not be blank.",
"REQUIRED": "This value is required.",
"REGEXP": "This value seems to be invalid.",
"MIN": "This value should be greater than or equal to %s.",
"MAX": "This value should be lower than or equal to %s.",
"RANGE": "This value should be between %s and %s.",
"MIN_LENGTH": "This value is too short. It should have %s characters or more.",
"MAX_LENGTH": "This value is too long. It should have %s characters or less.",
"RANGE_LENGTH": "This value length is invalid. It should be between %s and %s characters long.",
"MIN_CHECK": "You must select at least %s choices.",
"MAX_CHECK": "You must select %s choices or less.",
"RANGE_CHECK": "You must select between %s and %s choices.",
"EQUAL_TO": "This value should be the same."
},
"TAGS": {
"PLACEHOLDER": "Afegir tag",
"DELETE": "Esborrar tag",

View File

@ -36,6 +36,31 @@
"EXTERNAL_USER": "an external user",
"GENERIC_ERROR": "One of our Oompa Loompas says {{error}}.",
"IOCAINE_TEXT": "Feeling a bit overwhelmed by a task? Make sure others know about it by clicking on Iocaine when editing a task. It's possible to become immune to this (fictional) deadly poison by consuming small amounts over time just as it's possible to get better at what you do by occasionally taking on extra challenges!",
"FORM_ERRORS": {
"DEFAULT_MESSAGE": "This value seems to be invalid.",
"TYPE_EMAIL": "This value should be a valid email.",
"TYPE_URL": "This value should be a valid url.",
"TYPE_URLSTRICT": "This value should be a valid url.",
"TYPE_NUMBER": "This value should be a valid number.",
"TYPE_DIGITS": "This value should be digits.",
"TYPE_DATEISO": "This value should be a valid date (YYYY-MM-DD).",
"TYPE_ALPHANUM": "This value should be alphanumeric.",
"TYPE_PHONE": "This value should be a valid phone number.",
"NOTNULL": "This value should not be null.",
"NOT_BLANK": "This value should not be blank.",
"REQUIRED": "This value is required.",
"REGEXP": "This value seems to be invalid.",
"MIN": "This value should be greater than or equal to %s.",
"MAX": "This value should be lower than or equal to %s.",
"RANGE": "This value should be between %s and %s.",
"MIN_LENGTH": "This value is too short. It should have %s characters or more.",
"MAX_LENGTH": "This value is too long. It should have %s characters or less.",
"RANGE_LENGTH": "This value length is invalid. It should be between %s and %s characters long.",
"MIN_CHECK": "You must select at least %s choices.",
"MAX_CHECK": "You must select %s choices or less.",
"RANGE_CHECK": "You must select between %s and %s choices.",
"EQUAL_TO": "This value should be the same."
},
"TAGS": {
"PLACEHOLDER": "I'm it! Tag me...",
"DELETE": "Delete tag",

View File

@ -36,6 +36,31 @@
"EXTERNAL_USER": "un usuario externo",
"GENERIC_ERROR": "Uno de nuestros Oompa Loompas dice {{error}}.",
"IOCAINE_TEXT": "¿Te sientes fuera de tu zona de confort en una tarea? Asegúrate de que los demás están al tanto de ello, marca el check de la Iocaína al editar una tarea. Igual eu era posible llegar a ser inmune a este veneno mortal a base de consumir pequeñas dosis a lo largo del tiempo, es posible conseguir mejor en lo que estás haciendo si afrontas de vez en cuando esta clase de retos!",
"FORM_ERRORS": {
"DEFAULT_MESSAGE": "Este valor parece inválido.",
"TYPE_EMAIL": "El valor debe ser un email.",
"TYPE_URL": "El valor debe ser una url.",
"TYPE_URLSTRICT": "El valor debe ser una url.",
"TYPE_NUMBER": "El valor debe ser un número.",
"TYPE_DIGITS": "El valor deben ser digitos.",
"TYPE_DATEISO": "El valor debe ser una fecha válida (DD-MM-YYY)",
"TYPE_ALPHANUM": "El valor debe ser alfanumérico.",
"TYPE_PHONE": "El valor debe ser un teléfono válido.",
"NOTNULL": "No puede ser un valor nulo.",
"NOT_BLANK": "El valor no puede quedar en blanco.",
"REQUIRED": "Valor requerido.",
"REGEXP": "Este valor parece inválido.",
"MIN": "El valor debe ser mayor o igual que %s.",
"MAX": "El valor debe ser menor o igual que %s.",
"RANGE": "El valor debe estar entre %s y %s.",
"MIN_LENGTH": "El valor es demasiado corto. Debe contener al menos %s caracteres.",
"MAX_LENGTH": "El valor es demasiado corto. Debe contener %s caracteres como máximo.",
"RANGE_LENGTH": "Longitud erronea. Debe estar entre %s y %s caracteres.",
"MIN_CHECK": "Debes seleccionar al menos %s.",
"MAX_CHECK": "Debes seleccionar %s o menos.",
"RANGE_CHECK": "Debes seleccionar de %s a %s.",
"EQUAL_TO": "Este valor debe ser el mismo."
},
"TAGS": {
"PLACEHOLDER": "¿Qué soy? Etiquétame...",
"DELETE": "Borrar etiqueta",

View File

@ -36,6 +36,31 @@
"EXTERNAL_USER": "ulkoinen käyttäjä",
"GENERIC_ERROR": "Oompa Loompas havaitsivat virheen {{error}}.",
"IOCAINE_TEXT": "Jos tehtävä ahdistaa, merkitse se hidasteeksi.",
"FORM_ERRORS": {
"DEFAULT_MESSAGE": "This value seems to be invalid.",
"TYPE_EMAIL": "This value should be a valid email.",
"TYPE_URL": "This value should be a valid url.",
"TYPE_URLSTRICT": "This value should be a valid url.",
"TYPE_NUMBER": "This value should be a valid number.",
"TYPE_DIGITS": "This value should be digits.",
"TYPE_DATEISO": "This value should be a valid date (YYYY-MM-DD).",
"TYPE_ALPHANUM": "This value should be alphanumeric.",
"TYPE_PHONE": "This value should be a valid phone number.",
"NOTNULL": "This value should not be null.",
"NOT_BLANK": "This value should not be blank.",
"REQUIRED": "This value is required.",
"REGEXP": "This value seems to be invalid.",
"MIN": "This value should be greater than or equal to %s.",
"MAX": "This value should be lower than or equal to %s.",
"RANGE": "This value should be between %s and %s.",
"MIN_LENGTH": "This value is too short. It should have %s characters or more.",
"MAX_LENGTH": "This value is too long. It should have %s characters or less.",
"RANGE_LENGTH": "This value length is invalid. It should be between %s and %s characters long.",
"MIN_CHECK": "You must select at least %s choices.",
"MAX_CHECK": "You must select %s choices or less.",
"RANGE_CHECK": "You must select between %s and %s choices.",
"EQUAL_TO": "This value should be the same."
},
"TAGS": {
"PLACEHOLDER": "Anna avainsana...",
"DELETE": "Poista avainsana",

View File

@ -36,6 +36,31 @@
"EXTERNAL_USER": "an external user",
"GENERIC_ERROR": "L'un de nos Ooompa Loompas dit {{error}}.",
"IOCAINE_TEXT": "Vous vous sentez un peu submergé par une tâche ? Soyez certains d'en informer les autres en cliquant su Iocaine lors de la modification de la tâche. Il est possible de s'immuniser contre ce poison (fictif) en consommant de petites quantités en heures supplémentaires, tout comme il est possible de s'améliorer en acceptant parfois de nouveaux défis !",
"FORM_ERRORS": {
"DEFAULT_MESSAGE": "This value seems to be invalid.",
"TYPE_EMAIL": "This value should be a valid email.",
"TYPE_URL": "This value should be a valid url.",
"TYPE_URLSTRICT": "This value should be a valid url.",
"TYPE_NUMBER": "This value should be a valid number.",
"TYPE_DIGITS": "This value should be digits.",
"TYPE_DATEISO": "This value should be a valid date (YYYY-MM-DD).",
"TYPE_ALPHANUM": "This value should be alphanumeric.",
"TYPE_PHONE": "This value should be a valid phone number.",
"NOTNULL": "This value should not be null.",
"NOT_BLANK": "This value should not be blank.",
"REQUIRED": "This value is required.",
"REGEXP": "This value seems to be invalid.",
"MIN": "This value should be greater than or equal to %s.",
"MAX": "This value should be lower than or equal to %s.",
"RANGE": "This value should be between %s and %s.",
"MIN_LENGTH": "This value is too short. It should have %s characters or more.",
"MAX_LENGTH": "This value is too long. It should have %s characters or less.",
"RANGE_LENGTH": "This value length is invalid. It should be between %s and %s characters long.",
"MIN_CHECK": "You must select at least %s choices.",
"MAX_CHECK": "You must select %s choices or less.",
"RANGE_CHECK": "You must select between %s and %s choices.",
"EQUAL_TO": "This value should be the same."
},
"TAGS": {
"PLACEHOLDER": "Taggez moi !",
"DELETE": "Supprimer l'étiquette",

View File

@ -36,6 +36,31 @@
"EXTERNAL_USER": "外部使用者",
"GENERIC_ERROR": "我們的系統指出{{error}}.",
"IOCAINE_TEXT": "感到任務的不堪負荷確認其它人在編輯任務時知道此狀況可以點選Iocaine。它可能會成為免疫的致命狀況只要長期小量消耗但如果你只是偶而挑戰它可有助表現。",
"FORM_ERRORS": {
"DEFAULT_MESSAGE": "This value seems to be invalid.",
"TYPE_EMAIL": "This value should be a valid email.",
"TYPE_URL": "This value should be a valid url.",
"TYPE_URLSTRICT": "This value should be a valid url.",
"TYPE_NUMBER": "This value should be a valid number.",
"TYPE_DIGITS": "This value should be digits.",
"TYPE_DATEISO": "This value should be a valid date (YYYY-MM-DD).",
"TYPE_ALPHANUM": "This value should be alphanumeric.",
"TYPE_PHONE": "This value should be a valid phone number.",
"NOTNULL": "This value should not be null.",
"NOT_BLANK": "This value should not be blank.",
"REQUIRED": "This value is required.",
"REGEXP": "This value seems to be invalid.",
"MIN": "This value should be greater than or equal to %s.",
"MAX": "This value should be lower than or equal to %s.",
"RANGE": "This value should be between %s and %s.",
"MIN_LENGTH": "This value is too short. It should have %s characters or more.",
"MAX_LENGTH": "This value is too long. It should have %s characters or less.",
"RANGE_LENGTH": "This value length is invalid. It should be between %s and %s characters long.",
"MIN_CHECK": "You must select at least %s choices.",
"MAX_CHECK": "You must select %s choices or less.",
"RANGE_CHECK": "You must select between %s and %s choices.",
"EQUAL_TO": "This value should be the same."
},
"TAGS": {
"PLACEHOLDER": "我在這裏,請標注我",
"DELETE": "刪除Tag",