Fixed hard-coded messages.

Hard-coded messages in the UI have been replaced with I18n messages.

Ticket #1396
This commit is contained in:
Endi S. Dewata 2011-06-30 14:33:33 -04:00 committed by Adam Young
parent d70ba68401
commit 2a52723465
9 changed files with 228 additions and 116 deletions

View File

@ -844,7 +844,8 @@ IPA.association_facet = function (spec) {
'class': 'right-aligned-facet-controls' 'class': 'right-aligned-facet-controls'
}).appendTo(that.controls); }).appendTo(that.controls);
span.append('Show Results '); span.append(IPA.messages.association.show_results);
span.append(' ');
that.direct_radio = $('<input/>', { that.direct_radio = $('<input/>', {
type: 'radio', type: 'radio',
@ -857,7 +858,9 @@ IPA.association_facet = function (spec) {
} }
}).appendTo(span); }).appendTo(span);
span.append(' Direct Enrollment '); span.append(' ');
span.append(IPA.messages.association.direct_enrollment);
span.append(' ');
that.indirect_radio = $('<input/>', { that.indirect_radio = $('<input/>', {
type: 'radio', type: 'radio',
@ -870,7 +873,8 @@ IPA.association_facet = function (spec) {
} }
}).appendTo(span); }).appendTo(span);
span.append(' Indirect Enrollment'); span.append(' ');
span.append(IPA.messages.association.indirect_enrollment);
} }
}; };
@ -1007,7 +1011,7 @@ IPA.association_facet = function (spec) {
var pkeys = that.data[that.get_attribute_name()]; var pkeys = that.data[that.get_attribute_name()];
if (!pkeys || !pkeys.length) { if (!pkeys || !pkeys.length) {
that.table.empty(); that.table.empty();
that.table.summary.text('No entries.'); that.table.summary.text(IPA.messages.association.no_entries);
return; return;
} }
@ -1018,7 +1022,10 @@ IPA.association_facet = function (spec) {
var end = that.table.current_page * that.table.page_length; var end = that.table.current_page * that.table.page_length;
end = end > total ? total : end; end = end > total ? total : end;
var summary = 'Showing '+start+' to '+end+' of '+total+' entries.'; var summary = IPA.messages.association.paging;
summary = summary.replace('${start}', start);
summary = summary.replace('${end}', end);
summary = summary.replace('${total}', total);
that.table.summary.text(summary); that.table.summary.text(summary);
var list = pkeys.slice(start-1, end); var list = pkeys.slice(start-1, end);

View File

@ -87,21 +87,23 @@ IPA.entity_factories.automountmap = function() {
fields:[{factory:IPA.method_radio_widget, fields:[{factory:IPA.method_radio_widget,
name: 'method', name: 'method',
undo: false, undo: false,
label:'Map Type', label: IPA.messages.objects.automountmap.map_type,
options:[{value:'add',label:'Direct'}, options: [
{value:'add_indirect',label:'Indirect'}] { value: 'add', label: IPA.messages.objects.automountmap.direct },
{ value: 'add_indirect', label: IPA.messages.objects.automountmap.indirect }
]
}, },
'automountmapname','description', 'automountmapname','description',
{ {
name:'key', name: 'key',
label:'Mount Point', label: IPA.get_method_option('automountmap_add_indirect', 'key').label,
conditional:true, conditional: true,
undo: false undo: false
}, },
{ {
name:'parentmap', name: 'parentmap',
label:'Parent Map', label: IPA.get_method_option('automountmap_add_indirect', 'parentmap').label,
conditional:true, conditional: true,
undo: false undo: false
}] }]
}). }).

View File

@ -33,17 +33,17 @@ IPA.cert.CERTIFICATE_STATUS_VALID = 1;
IPA.cert.CERTIFICATE_STATUS_REVOKED = 2; IPA.cert.CERTIFICATE_STATUS_REVOKED = 2;
IPA.cert.CRL_REASON = [ IPA.cert.CRL_REASON = [
'Unspecified', 'unspecified',
'Key Compromise', 'key_compromise',
'CA Compromise', 'ca_compromise',
'Affiliation Changed', 'affiliation_changed',
'Superseded', 'superseded',
'Cessation of Operation', 'cessation_of_operation',
'Certificate Hold', 'certificate_hold',
null, null,
'Remove from CRL', 'remove_from_crl',
'Privilege Withdrawn', 'privilege_withdrawn',
'AA Compromise' 'aa_compromise'
]; ];
IPA.cert.parse_dn = function(dn) { IPA.cert.parse_dn = function(dn) {
@ -155,10 +155,11 @@ IPA.cert.revoke_dialog = function(spec) {
that.select = $('<select/>').appendTo(td); that.select = $('<select/>').appendTo(td);
for (var i=0; i<IPA.cert.CRL_REASON.length; i++) { for (var i=0; i<IPA.cert.CRL_REASON.length; i++) {
if (!IPA.cert.CRL_REASON[i]) continue; var reason = IPA.cert.CRL_REASON[i];
if (!reason) continue;
$('<option/>', { $('<option/>', {
'value': i, 'value': i,
'html': IPA.cert.CRL_REASON[i] 'html': IPA.messages.objects.cert[reason]
}).appendTo(that.select); }).appendTo(that.select);
} }
}; };
@ -616,8 +617,10 @@ IPA.cert.status_widget = function(spec) {
if (!that.is_selfsign()) { if (!that.is_selfsign()) {
that.status_revoked.css('display', status == IPA.cert.CERTIFICATE_STATUS_REVOKED ? 'inline' : 'none'); that.status_revoked.css('display', status == IPA.cert.CERTIFICATE_STATUS_REVOKED ? 'inline' : 'none');
that.revoke_button.css('display', status == IPA.cert.CERTIFICATE_STATUS_VALID ? 'inline' : 'none'); that.revoke_button.css('display', status == IPA.cert.CERTIFICATE_STATUS_VALID ? 'inline' : 'none');
that.revocation_reason.html(revocation_reason == undefined ? '' : IPA.cert.CRL_REASON[revocation_reason]);
that.restore_button.css('display', revocation_reason == 6 ? 'inline' : 'none'); var reason = IPA.cert.CRL_REASON[revocation_reason];
that.revocation_reason.html(revocation_reason === undefined || reason === null ? '' : IPA.messages.objects.cert[reason]);
that.restore_button.css('display', reason == 'certificate_hold' ? 'inline' : 'none');
} }
} }

View File

@ -388,7 +388,7 @@ IPA.details_facet = function(spec) {
that.expand_button = IPA.action_button({ that.expand_button = IPA.action_button({
name: 'expand_all', name: 'expand_all',
href: 'expand_all', href: 'expand_all',
label: 'Expand All', label: IPA.messages.details.expand_all,
'class': 'right-aligned-facet-controls', 'class': 'right-aligned-facet-controls',
style: 'display: none;', style: 'display: none;',
click: function() { click: function() {
@ -407,7 +407,7 @@ IPA.details_facet = function(spec) {
that.collapse_button = IPA.action_button({ that.collapse_button = IPA.action_button({
name: 'collapse_all', name: 'collapse_all',
href: 'collapse_all', href: 'collapse_all',
label: 'Collapse All', label: IPA.messages.details.collapse_all,
'class': 'right-aligned-facet-controls', 'class': 'right-aligned-facet-controls',
click: function() { click: function() {
that.expand_button.css('display', 'inline'); that.expand_button.css('display', 'inline');

View File

@ -68,11 +68,11 @@ IPA.entity_factories.dnszone = function() {
}, },
{ {
name: 'type', name: 'type',
label: 'Record Type' label: IPA.messages.objects.dnsrecord.type
}, },
{ {
name: 'data', name: 'data',
label: 'Data' label: IPA.messages.objects.dnsrecord.data
} }
] ]
}). }).
@ -175,8 +175,12 @@ IPA.dnsrecord_facet = function(spec) {
that.add = function() { that.add = function() {
var title = IPA.messages.dialogs.add_title;
var label = IPA.metadata.objects.dnsrecord.label_singular;
title = title.replace('${entity}', label);
var dialog = IPA.dialog({ var dialog = IPA.dialog({
title: IPA.messages.objects.dnsrecord.add title: title
}); });
dialog.create = function() { dialog.create = function() {
@ -184,7 +188,7 @@ IPA.dnsrecord_facet = function(spec) {
var dl = $('<dl/>').appendTo(dialog.container); var dl = $('<dl/>').appendTo(dialog.container);
$('<dt/>', { $('<dt/>', {
html: IPA.messages.objects.dnsrecord.resource html: IPA.get_entity_param('dnsrecord', 'idnsname').label
}).appendTo(dl); }).appendTo(dl);
var dd = $('<dd/>').appendTo(dl); var dd = $('<dd/>').appendTo(dl);
@ -275,23 +279,38 @@ IPA.dnsrecord_facet = function(spec) {
}); });
}); });
var title = IPA.messages.dialogs.remove_title;
var label = IPA.metadata.objects.dnsrecord.label;
title = title.replace('${entity}', label);
var dialog = IPA.dialog({ var dialog = IPA.dialog({
title: IPA.messages.buttons.remove title: title
}); });
dialog.create = function() { dialog.create = function() {
var to_delete_table = var table = $('<table/>', {
$('<table class="search-table" >'+ 'class': 'search-table'
'<thead><tr><th>Resource</th><th>Type</th></tr></thead>'+ }).appendTo(dialog.container);
'<tbody></tbody></table>').appendTo(dialog.container);
var to_delete_body = to_delete_table.find('tbody'); var thead = $('<thead/>').appendTo(table);
var tr = $('<tr/>').appendTo(thead);
$('<th/>', {
text: IPA.get_entity_param('dnsrecord', 'idnsname').label
}).appendTo(tr);
$('<th/>', {
text: IPA.messages.objects.dnsrecord.type
}).appendTo(tr);
var tbody = $('<tbody/>').appendTo(table);
for (var i=0; i<records.length; i++) { for (var i=0; i<records.length; i++) {
var record = records[i]; var record = records[i];
var tr = $('<tr></tr>').appendTo(to_delete_body); tr = $('<tr/>').appendTo(tbody);
$('<td/>', { $('<td/>', {
html: record.resource html: record.resource

View File

@ -39,12 +39,12 @@ IPA.entity_factories.entitle = function() {
name: 'entitle' name: 'entitle'
}). }).
facet_groups([ facet_groups([
{ name: 'account', label: 'Account' }, { name: 'account', label: IPA.messages.objects.entitle.account },
{ name: 'certificates', label: 'Certificates' } { name: 'certificates', label: IPA.messages.objects.entitle.certificates }
]). ]).
details_facet({ details_facet({
factory: IPA.entitle.details_facet, factory: IPA.entitle.details_facet,
label: 'Account', label: IPA.messages.objects.entitle.account,
facet_group: 'account', facet_group: 'account',
sections: [ sections: [
{ {
@ -53,33 +53,33 @@ IPA.entity_factories.entitle = function() {
fields: [ fields: [
{ {
name: 'uuid', name: 'uuid',
label: 'UUID', label: IPA.get_method_option('entitle_register', 'ipaentitlementid').label,
read_only: true read_only: true
}, },
{ {
factory: IPA.entitle.download_widget, factory: IPA.entitle.download_widget,
name: 'certificate', name: 'certificate',
label: 'Certificate' label: IPA.messages.objects.entitle.certificate
} }
] ]
}, },
{ {
name: 'status', name: 'status',
label: 'Status', label: IPA.messages.objects.entitle.status,
fields: [ fields: [
{ {
name: 'product', name: 'product',
label: 'Product', label: IPA.messages.objects.entitle.product,
read_only: true read_only: true
}, },
{ {
name: 'quantity', name: 'quantity',
label: 'Quantity', label: IPA.get_method_arg('entitle_consume', 'quantity').label,
read_only: true read_only: true
}, },
{ {
name: 'consumed', name: 'consumed',
label: 'Consumed', label: IPA.messages.objects.entitle.consumed,
read_only: true read_only: true
} }
] ]
@ -89,29 +89,29 @@ IPA.entity_factories.entitle = function() {
search_facet({ search_facet({
factory: IPA.entitle.search_facet, factory: IPA.entitle.search_facet,
name: 'certificates', name: 'certificates',
label: 'Certificates', label: IPA.messages.objects.entitle.certificates,
facet_group: 'certificates', facet_group: 'certificates',
columns: [ columns: [
{ {
name: 'product', name: 'product',
label: 'Product' label: IPA.messages.objects.entitle.product
}, },
{ {
name: 'quantity', name: 'quantity',
label: 'Quantity' label: IPA.get_method_arg('entitle_consume', 'quantity').label
}, },
{ {
name: 'start', name: 'start',
label: 'Start' label: IPA.messages.objects.entitle.start
}, },
{ {
name: 'end', name: 'end',
label: 'End' label: IPA.messages.objects.entitle.end
}, },
{ {
factory: IPA.entitle.certificate_column, factory: IPA.entitle.certificate_column,
name: 'certificate', name: 'certificate',
label: 'Certificate' label: IPA.messages.objects.entitle.certificate
} }
] ]
}). }).
@ -119,11 +119,11 @@ IPA.entity_factories.entitle = function() {
dialog({ dialog({
factory: IPA.entitle.register_online_dialog, factory: IPA.entitle.register_online_dialog,
name: 'online_registration', name: 'online_registration',
title: 'Registration', title: IPA.messages.objects.entitle.registration,
fields: [ fields: [
{ {
name: 'username', name: 'username',
label: 'Username', label: IPA.get_method_arg('entitle_register', 'username').label,
undo: false undo: false
}, },
{ {
@ -142,13 +142,12 @@ IPA.entity_factories.entitle = function() {
dialog({ dialog({
factory: IPA.entitle.register_offline_dialog, factory: IPA.entitle.register_offline_dialog,
name: 'offline_registration', name: 'offline_registration',
title: 'Import Certificate', title: IPA.messages.objects.entitle.import_certificate,
message: 'Enter the Base64-encoded entitlement certificate below:', message: IPA.messages.objects.entitle.import_message,
label: 'Import',
fields: [ fields: [
{ {
name: 'certificate', name: 'certificate',
label: 'Certificate', label: IPA.messages.objects.entitle.certificate,
undo: false undo: false
} }
] ]
@ -156,11 +155,11 @@ IPA.entity_factories.entitle = function() {
dialog({ dialog({
factory: IPA.entitle.consume_dialog, factory: IPA.entitle.consume_dialog,
name: 'consume', name: 'consume',
title: 'Consume Entitlement', title: IPA.messages.objects.entitle.consume_entitlement,
fields: [ fields: [
{ {
name: 'quantity', name: 'quantity',
label: 'Quantity', label: IPA.get_method_arg('entitle_consume', 'quantity').label,
undo: false, undo: false,
metadata: IPA.get_method_arg('entitle_consume', 'quantity') metadata: IPA.get_method_arg('entitle_consume', 'quantity')
} }
@ -169,13 +168,12 @@ IPA.entity_factories.entitle = function() {
dialog({ dialog({
factory: IPA.entitle.import_dialog, factory: IPA.entitle.import_dialog,
name: 'import', name: 'import',
title: 'Import Certificate', title: IPA.messages.objects.entitle.import_certificate,
message: 'Enter the Base64-encoded entitlement certificate below:', message: IPA.messages.objects.entitle.import_message,
label: 'Import',
fields: [ fields: [
{ {
name: 'certificate', name: 'certificate',
label: 'Certificate', label: IPA.messages.objects.entitle.certificate,
undo: false undo: false
} }
] ]
@ -338,7 +336,7 @@ IPA.entitle.details_facet = function(spec) {
that.register_online_button = IPA.action_button({ that.register_online_button = IPA.action_button({
name: 'register', name: 'register',
label: 'Register', label: IPA.messages.objects.entitle.register,
icon: 'ui-icon-plus', icon: 'ui-icon-plus',
click: function() { click: function() {
var dialog = that.entity.get_dialog('online_registration'); var dialog = that.entity.get_dialog('online_registration');
@ -351,7 +349,7 @@ IPA.entitle.details_facet = function(spec) {
/* /*
that.register_offline_button = IPA.action_button({ that.register_offline_button = IPA.action_button({
name: 'import', name: 'import',
label: 'Import', label: IPA.messages.objects.entitle.import,
icon: 'ui-icon-plus', icon: 'ui-icon-plus',
click: function() { click: function() {
var dialog = that.entity.get_dialog('offline_registration'); var dialog = that.entity.get_dialog('offline_registration');
@ -367,7 +365,7 @@ IPA.entitle.details_facet = function(spec) {
that.refresh = function() { that.refresh = function() {
var summary = $('span[name=summary]', that.container).empty(); var summary = $('span[name=summary]', that.container).empty();
summary.append('Loading...'); summary.append(IPA.messages.objects.entitle.loading);
function on_success(data, text_status, xhr) { function on_success(data, text_status, xhr) {
if (that.entity.status == IPA.entitle.unregistered) { if (that.entity.status == IPA.entitle.unregistered) {
@ -427,7 +425,7 @@ IPA.entitle.search_facet = function(spec) {
that.consume_button = IPA.action_button({ that.consume_button = IPA.action_button({
name: 'consume', name: 'consume',
label: 'Consume', label: IPA.messages.objects.entitle.consume,
icon: 'ui-icon-plus', icon: 'ui-icon-plus',
click: function() { click: function() {
var dialog = that.entity.get_dialog('consume'); var dialog = that.entity.get_dialog('consume');
@ -440,7 +438,7 @@ IPA.entitle.search_facet = function(spec) {
that.import_button = IPA.action_button({ that.import_button = IPA.action_button({
name: 'import', name: 'import',
label: 'Import', label: IPA.messages.objects.entitle.import_button,
icon: 'ui-icon-plus', icon: 'ui-icon-plus',
click: function() { click: function() {
var dialog = that.entity.get_dialog('import'); var dialog = that.entity.get_dialog('import');
@ -516,10 +514,10 @@ IPA.entitle.certificate_column = function(spec) {
$('<a/>', { $('<a/>', {
'href': '#download', 'href': '#download',
'html': 'Download', 'html': IPA.messages.objects.entitle.download,
'click': function() { 'click': function() {
var dialog = IPA.cert.download_dialog({ var dialog = IPA.cert.download_dialog({
title: 'Download Certificate', title: IPA.messages.objects.entitle.download_certificate,
certificate: certificate, certificate: certificate,
add_pem_delimiters: false add_pem_delimiters: false
}); });
@ -576,7 +574,7 @@ IPA.entitle.register_online_dialog = function(spec) {
var that = IPA.dialog(spec); var that = IPA.dialog(spec);
that.add_button('Register', function() { that.add_button(IPA.messages.objects.entitle.register, function() {
var record = {}; var record = {};
that.save(record); that.save(record);
@ -593,7 +591,7 @@ IPA.entitle.register_online_dialog = function(spec) {
); );
}); });
that.add_button('Cancel', function() { that.add_button(IPA.messages.buttons.cancel, function() {
that.close(); that.close();
}); });
@ -631,7 +629,7 @@ IPA.entitle.consume_dialog = function(spec) {
var that = IPA.dialog(spec); var that = IPA.dialog(spec);
that.add_button('Consume', function() { that.add_button(IPA.messages.objects.entitle.consume, function() {
if (!that.is_valid()) { if (!that.is_valid()) {
return; return;
@ -651,7 +649,7 @@ IPA.entitle.consume_dialog = function(spec) {
); );
}); });
that.add_button('Cancel', function() { that.add_button(IPA.messages.buttons.cancel, function() {
that.close(); that.close();
}); });
@ -692,18 +690,18 @@ IPA.entitle.download_widget = function(spec) {
that.create = function(container) { that.create = function(container) {
that.link = $('<a/>', { that.link = $('<a/>', {
'href': '#download', 'href': '#download',
'html': 'Download', 'html': IPA.messages.objects.entitle.download,
'click': function() { 'click': function() {
that.entity.get_accounts( that.entity.get_accounts(
function(data, text_status, xhr) { function(data, text_status, xhr) {
var userpkcs12 = data.result.result[0].userpkcs12; var userpkcs12 = data.result.result[0].userpkcs12;
if (!userpkcs12) { if (!userpkcs12) {
alert('No certificate.'); alert(IPA.messages.objects.entitle.no_certificate);
return; return;
} }
var dialog = IPA.cert.download_dialog({ var dialog = IPA.cert.download_dialog({
title: 'Download Certificate', title: IPA.messages.objects.entitle.download_certificate,
certificate: userpkcs12[0].__base64__, certificate: userpkcs12[0].__base64__,
add_pem_delimiters: false add_pem_delimiters: false
}); });

View File

@ -15553,7 +15553,12 @@
}, },
"association": { "association": {
"add": "Add ${other_entity} into ${entity} ${primary_key}", "add": "Add ${other_entity} into ${entity} ${primary_key}",
"remove": "Remove ${other_entity} from ${entity} ${primary_key}" "direct_enrollment": "Direct Enrollment",
"indirect_enrollment": "Indirect Enrollment",
"no_entries": "No entries.",
"paging": "Showing ${start} to ${end} of ${total} entries.",
"remove": "Remove ${other_entity} from ${entity} ${primary_key}",
"show_results": "Show Results"
}, },
"buttons": { "buttons": {
"add": "Add", "add": "Add",
@ -15577,6 +15582,8 @@
"view": "View" "view": "View"
}, },
"details": { "details": {
"collapse_all": "Collapse All",
"expand_all": "Expand All",
"general": "General", "general": "General",
"identity": "Identity Settings", "identity": "Identity Settings",
"settings": "${entity} ${primary_key} Settings", "settings": "${entity} ${primary_key} Settings",
@ -15615,7 +15622,11 @@
"automountlocation": { "automountlocation": {
"identity": "Automount Location Settings" "identity": "Automount Location Settings"
}, },
"automountmap": {}, "automountmap": {
"direct": "Direct",
"indirect": "Indirect",
"map_type": "Map Type"
},
"cert": { "cert": {
"aa_compromise": "AA Compromise", "aa_compromise": "AA Compromise",
"affiliation_changed": "Affiliation Changed", "affiliation_changed": "Affiliation Changed",
@ -15663,13 +15674,33 @@
"delegation": {}, "delegation": {},
"dnsrecord": { "dnsrecord": {
"data": "Data", "data": "Data",
"resource": "Resource",
"title": "Records for DNS Zone", "title": "Records for DNS Zone",
"type": "Type" "type": "Record Type"
}, },
"dnszone": { "dnszone": {
"identity": "DNS Zone Settings" "identity": "DNS Zone Settings"
}, },
"entitle": {
"account": "Account",
"certificate": "Certificate",
"certificates": "Certificates",
"consume": "Consume",
"consume_entitlement": "Consume Entitlement",
"consumed": "Consumed",
"download": "Download",
"download_certificate": "Download Certificate",
"end": "End",
"import_button": "Import",
"import_certificate": "Import Certificate",
"import_message": "Enter the Base64-encoded entitlement certificate below:",
"loading": "Loading...",
"no_certificate": "No Certificate.",
"product": "Product",
"register": "Register",
"registration": "Registration",
"start": "Start",
"status": "Status"
},
"group": { "group": {
"details": "Group Settings", "details": "Group Settings",
"posix": "Is this a POSIX group?" "posix": "Is this a POSIX group?"
@ -15820,8 +15851,17 @@
"sudo": "Sudo" "sudo": "Sudo"
}, },
"widget": { "widget": {
"next": "Next",
"optional": "Optional field: click to show", "optional": "Optional field: click to show",
"validation_error": "Text does not match field pattern" "page": "Page",
"prev": "Prev",
"validation": {
"error": "Text does not match field pattern",
"integer": "Must be an integer",
"max_value": "Maximum value is ${value}",
"min_value": "Minimum value is ${value}",
"required": "Required field"
}
} }
} }
}, },
@ -15848,17 +15888,17 @@
], ],
"krbextradata": [ "krbextradata": [
{ {
"__base64__": "AAgBAA==" "__base64__": "AAKl9AlOcm9vdC9hZG1pbkBTRVJWRVIxNS5BWU9VTkcuQk9TVE9OLkRFVkVMLlJFREhBVC5DT00A"
}, },
{ {
"__base64__": "AAKl9AlOcm9vdC9hZG1pbkBTRVJWRVIxNS5BWU9VTkcuQk9TVE9OLkRFVkVMLlJFREhBVC5DT00A" "__base64__": "AAgBAA=="
} }
], ],
"krblastpwdchange": [ "krblastpwdchange": [
"20110628153501Z" "20110628153501Z"
], ],
"krblastsuccessfulauth": [ "krblastsuccessfulauth": [
"20110629132818Z" "20110630175326Z"
], ],
"krbpasswordexpiration": [ "krbpasswordexpiration": [
"20110926153501Z" "20110926153501Z"

View File

@ -78,6 +78,7 @@ IPA.widget = function(spec) {
that.hide_error(); that.hide_error();
that.valid = true; that.valid = true;
var message;
var values = that.save(); var values = that.save();
if (!values || !values.length) { if (!values || !values.length) {
@ -85,7 +86,7 @@ IPA.widget = function(spec) {
that.param_info.required && that.param_info.required &&
!that.optional) { !that.optional) {
that.valid = false; that.valid = false;
that.show_error('required field'); that.show_error(IPA.messages.widget.validation.required);
} }
return; return;
} }
@ -99,22 +100,23 @@ IPA.widget = function(spec) {
if (that.metadata.type == 'int') { if (that.metadata.type == 'int') {
if (!value.match(/^-?\d+$/)) { if (!value.match(/^-?\d+$/)) {
that.valid = false; that.valid = false;
// TODO: I18n that.show_error(IPA.messages.widget.validation.integer);
that.show_error('must be an integer');
return; return;
} }
if (that.metadata.minvalue && value < that.metadata.minvalue) { if (that.metadata.minvalue && value < that.metadata.minvalue) {
that.valid = false; that.valid = false;
// TODO: I18n message = IPA.messages.widget.validation.min_value;
that.show_error('minimum value is '+that.metadata.minvalue); message = message.replace('${value}', that.metadata.minvalue);
that.show_error(message);
return; return;
} }
if (that.metadata.maxvalue && value > that.metadata.maxvalue) { if (that.metadata.maxvalue && value > that.metadata.maxvalue) {
that.valid = false; that.valid = false;
// TODO: I18n message = IPA.messages.widget.validation.max_value;
that.show_error('maximum value is '+that.metadata.maxvalue); message = message.replace('${value}', that.metadata.maxvalue);
that.show_error(message);
return; return;
} }
} }
@ -386,7 +388,7 @@ IPA.text_widget = function(spec) {
$('<span/>', { $('<span/>', {
name: 'error_link', name: 'error_link',
html: IPA.messages.widget.validation_error, html: IPA.messages.widget.validation.error,
'class': 'ui-state-error ui-corner-all', 'class': 'ui-state-error ui-corner-all',
style: 'display:none' style: 'display:none'
}).appendTo(container); }).appendTo(container);
@ -541,7 +543,7 @@ IPA.multivalued_text_widget = function(spec) {
$('<span/>', { $('<span/>', {
name: 'error_link', name: 'error_link',
html: IPA.messages.widget.validation_error, html: IPA.messages.widget.validation.error,
'class': 'ui-state-error ui-corner-all', 'class': 'ui-state-error ui-corner-all',
style: 'display:none' style: 'display:none'
}).appendTo(div); }).appendTo(div);
@ -1065,7 +1067,7 @@ IPA.textarea_widget = function (spec) {
$("<span/>",{ $("<span/>",{
name:'error_link', name:'error_link',
html: IPA.messages.widget.validation_error, html: IPA.messages.widget.validation.error,
"class":"ui-state-error ui-corner-all", "class":"ui-state-error ui-corner-all",
style:"display:none" style:"display:none"
}).appendTo(container); }).appendTo(container);
@ -1134,7 +1136,7 @@ IPA.column = function (spec) {
if (param_info) { if (param_info) {
that.label = param_info.label; that.label = param_info.label;
} else { } else {
alert('cannot find label for ' + that.entity_name + ' ' + alert('Cannot find label for ' + that.entity_name + ' ' +
that.name); that.name);
} }
} }
@ -1370,7 +1372,7 @@ IPA.table_widget = function (spec) {
if (that.page_length) { if (that.page_length) {
$('<a/>', { $('<a/>', {
text: 'Prev', text: IPA.messages.widget.prev,
name: 'prev_page', name: 'prev_page',
click: function() { click: function() {
that.prev_page(); that.prev_page();
@ -1381,7 +1383,7 @@ IPA.table_widget = function (spec) {
that.pagination.append(' '); that.pagination.append(' ');
$('<a/>', { $('<a/>', {
text: 'Next', text: IPA.messages.widget.next,
name: 'next_page', name: 'next_page',
click: function() { click: function() {
that.next_page(); that.next_page();
@ -1389,7 +1391,9 @@ IPA.table_widget = function (spec) {
} }
}).appendTo(that.pagination); }).appendTo(that.pagination);
that.pagination.append(' Page: '); that.pagination.append(' ');
that.pagination.append(IPA.messages.widget.page);
that.pagination.append(': ');
that.current_page_input = $('<input/>', { that.current_page_input = $('<input/>', {
type: 'text', type: 'text',

View File

@ -102,6 +102,9 @@ class i18n_messages(Command):
"identity":_("Automount Location Settings") "identity":_("Automount Location Settings")
}, },
"automountmap": { "automountmap": {
"map_type":_("Map Type"),
"direct":_("Direct"),
"indirect":_("Indirect"),
}, },
"automountkey": { "automountkey": {
}, },
@ -157,11 +160,31 @@ class i18n_messages(Command):
"identity":_("DNS Zone Settings"), "identity":_("DNS Zone Settings"),
}, },
"dnsrecord": { "dnsrecord": {
"resource":_("Resource"), "type":_("Record Type"),
"type":_("Type"),
"data":_("Data"), "data":_("Data"),
"title":_("Records for DNS Zone"), "title":_("Records for DNS Zone"),
}, },
"entitle": {
"account":_("Account"),
"certificate":_("Certificate"),
"certificates":_("Certificates"),
"consume":_("Consume"),
"consume_entitlement":_("Consume Entitlement"),
"consumed":_("Consumed"),
"download":_("Download"),
"download_certificate":_("Download Certificate"),
"end":_("End"),
"import_button":_("Import"),
"import_certificate":_("Import Certificate"),
"import_message":_("Enter the Base64-encoded entitlement certificate below:"),
"loading":_("Loading..."),
"no_certificate":_("No Certificate."),
"product":_("Product"),
"register":_("Register"),
"registration":_("Registration"),
"start":_("Start"),
"status":_("Status"),
},
"group": { "group": {
"details":_("Group Settings"), "details":_("Group Settings"),
"posix":_("Is this a POSIX group?"), "posix":_("Is this a POSIX group?"),
@ -295,7 +318,7 @@ class i18n_messages(Command):
"password_must_match":_("Passwords must match"), "password_must_match":_("Passwords must match"),
}, },
}, },
"buttons":{ "buttons": {
"add":_("Add"), "add":_("Add"),
"add_and_add_another":_("Add and Add Another"), "add_and_add_another":_("Add and Add Another"),
"add_and_edit":_("Add and Edit"), "add_and_edit":_("Add and Edit"),
@ -316,7 +339,7 @@ class i18n_messages(Command):
"update":_("Update"), "update":_("Update"),
"view":_("View"), "view":_("View"),
}, },
"dialogs":{ "dialogs": {
"add_title":_("Add ${entity}"), "add_title":_("Add ${entity}"),
"available":_("Available"), "available":_("Available"),
"dirty_message":_("This page has unsaved changes. Please save or revert."), "dirty_message":_("This page has unsaved changes. Please save or revert."),
@ -326,7 +349,7 @@ class i18n_messages(Command):
"remove_title":_("Remove ${entity}"), "remove_title":_("Remove ${entity}"),
"prospective":_("Prospective"), "prospective":_("Prospective"),
}, },
"facet_groups":{ "facet_groups": {
"managedby":_("Managed by"), "managedby":_("Managed by"),
"member":_("Member"), "member":_("Member"),
"memberindirect":_("Indirect Member"), "memberindirect":_("Indirect Member"),
@ -334,11 +357,11 @@ class i18n_messages(Command):
"memberofindirect":_("Indirect Member Of"), "memberofindirect":_("Indirect Member Of"),
"settings": _("Settings"), "settings": _("Settings"),
}, },
"facets":{ "facets": {
"search":_("Search"), "search":_("Search"),
"details": _("Settings"), "details": _("Settings"),
}, },
"search":{ "search": {
"quick_links":_("Quick Links"), "quick_links":_("Quick Links"),
"select_all":_("Select All"), "select_all":_("Select All"),
"unselect_all":_("Unselect All"), "unselect_all":_("Unselect All"),
@ -346,7 +369,9 @@ class i18n_messages(Command):
"truncated":_( "truncated":_(
"Query returned more results than the configured size limit. Displaying the first ${counter} results."), "Query returned more results than the configured size limit. Displaying the first ${counter} results."),
}, },
"details":{ "details": {
"collapse_all":_("Collapse All"),
"expand_all":_("Expand All"),
"general":_("General"), "general":_("General"),
"identity":_("Identity Settings"), "identity":_("Identity Settings"),
"settings":_("${entity} ${primary_key} Settings"), "settings":_("${entity} ${primary_key} Settings"),
@ -363,15 +388,29 @@ class i18n_messages(Command):
"role":_("Role Based Access Control"), "role":_("Role Based Access Control"),
"automount":_("Automount") "automount":_("Automount")
}, },
"association":{ "association": {
"add":_("Add ${other_entity} into ${entity} ${primary_key}"), "add":_("Add ${other_entity} into ${entity} ${primary_key}"),
"direct_enrollment":_("Direct Enrollment"),
"indirect_enrollment":_("Indirect Enrollment"),
"no_entries":_("No entries."),
"paging":_("Showing ${start} to ${end} of ${total} entries."),
"remove":_("Remove ${other_entity} from ${entity} ${primary_key}"), "remove":_("Remove ${other_entity} from ${entity} ${primary_key}"),
"show_results":_("Show Results"),
}, },
"widget":{ "widget": {
"next":_("Next"),
"optional":_("Optional field: click to show"), "optional":_("Optional field: click to show"),
"validation_error":_("Text does not match field pattern"), "page":_("Page"),
"prev":_("Prev"),
"validation": {
"error":_("Text does not match field pattern"),
"integer": _("Must be an integer"),
"max_value": _("Maximum value is ${value}"),
"min_value": _("Minimum value is ${value}"),
"required": _("Required field"),
},
}, },
"ajax":{ "ajax": {
"401":_("Your Kerberos ticket is no longer valid. Please run kinit and then click 'Retry'. If this is your first time running the IPA Web UI <a href='/ipa/config/unauthorized.html'>follow these directions</a> to configure your browser.") "401":_("Your Kerberos ticket is no longer valid. Please run kinit and then click 'Retry'. If this is your first time running the IPA Web UI <a href='/ipa/config/unauthorized.html'>follow these directions</a> to configure your browser.")
}, },
} }