From 468c1632ee8b23e2f49cfce4dcf2c26e027b4bf7 Mon Sep 17 00:00:00 2001 From: Ryan Bard Date: Mon, 8 Jul 2019 11:59:54 -0400 Subject: [PATCH] APF-2362: Add localized label and validator descriptions Signed-off-by: Ryan Bard --- samples/node/routes/discovery.js | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/samples/node/routes/discovery.js b/samples/node/routes/discovery.js index 5fb00dd..12bd03c 100644 --- a/samples/node/routes/discovery.js +++ b/samples/node/routes/discovery.js @@ -14,14 +14,38 @@ exports.root = function (req, res) { foo: { default: 'bar', type: 'STRING', + label: { + 'en-US': 'Foo', + 'es-ES': 'Foo' + }, description: { 'en-US': 'This ...', 'es-ES': 'Este ...' }, validators: [ - {type: 'required'}, - {type: 'regex', value: '^\\w+$'}, - {type: 'max_length', value: '10'} + { + type: 'required', + description: { + 'en-US': 'Foo is required', + 'es-ES': '...' + } + }, + { + type: 'regex', + value: '^\\w+$', + description: { + 'en-US': 'Foo must be only letters and number', + 'es-ES': '...' + } + }, + { + type: 'max_length', + value: '10', + description: { + 'en-US': 'Foo must not be more than 10 characters', + 'es-ES': '...' + } + } ] } },