diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2013-04-04 14:32:47 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2013-05-06 16:22:21 +0200 |
commit | 09296fc0b302d9a105aacad960c295991fa88a1d (patch) | |
tree | 54a4aef171dc65c250b8d01f0d79714d364a84df /install/ui/src/freeipa/field.js | |
parent | e3ea5e8d5050890a8e7f17271d04954f71dad325 (diff) | |
download | freeipa-09296fc0b302d9a105aacad960c295991fa88a1d.tar.gz freeipa-09296fc0b302d9a105aacad960c295991fa88a1d.tar.xz freeipa-09296fc0b302d9a105aacad960c295991fa88a1d.zip |
Use text.get for transforming values supplied by spec
https://fedorahosted.org/freeipa/ticket/3235
Diffstat (limited to 'install/ui/src/freeipa/field.js')
-rw-r--r-- | install/ui/src/freeipa/field.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/install/ui/src/freeipa/field.js b/install/ui/src/freeipa/field.js index 2f0912d27..ececd5421 100644 --- a/install/ui/src/freeipa/field.js +++ b/install/ui/src/freeipa/field.js @@ -22,8 +22,8 @@ */ -define(['dojo/_base/array', './ipa', './jquery', './navigation'], - function(array, IPA, $, navigation) { +define(['dojo/_base/array', './ipa', './jquery', './navigation', './text'], + function(array, IPA, $, navigation, text) { IPA.field = function(spec) { spec = spec || {}; @@ -41,8 +41,8 @@ IPA.field = function(spec) { * actual rights might be defined by other param. */ that.acl_param = spec.acl_param || that.param; - that.label = spec.label; - that.tooltip = spec.tooltip; + that.label = text.get(spec.label); + that.tooltip = text.get(spec.tooltip); that.measurement_unit = spec.measurement_unit; that.formatter = spec.formatter; @@ -79,11 +79,11 @@ IPA.field = function(spec) { that.metadata = IPA.get_entity_param(that.entity.name, that.param); } if (that.metadata) { - if (that.label === undefined) { - that.label = that.metadata.label; + if (!that.label) { + that.label = that.metadata.label || ''; } - if (that.tooltip === undefined) { - that.tooltip = that.metadata.doc; + if (!that.tooltip) { + that.tooltip = that.metadata.doc || ''; } } @@ -418,7 +418,7 @@ IPA.validator = function(spec) { var that = {}; - that.message = spec.message || IPA.get_message('widget.validation.error'); + that.message = text.get(spec.message || '@i18n:widget.validation.error'); that.false_result = function(message) { return { @@ -518,7 +518,7 @@ IPA.same_password_validator = function(spec) { var that = IPA.validator(spec); that.other_field = spec.other_field; - that.message = spec.message || IPA.get_message('password.password_must_match', + that.message = text.get(spec.message || '@i18n:password.password_must_match', "Passwords must match"); that.validate = function(value, context) { |