Skip to content
Snippets Groups Projects
Commit c8526ab0 authored by Sebastian Castro's avatar Sebastian Castro
Browse files

i18n: rename form_builder keys

parent 99cfd893
No related branches found
No related tags found
No related merge requests found
...@@ -15,47 +15,47 @@ ...@@ -15,47 +15,47 @@
var fbEditor = document.getElementById('form-builder-container'); var fbEditor = document.getElementById('form-builder-container');
var fields = [ var fields = [
{ label: t('config_form.custom_fields.title'), name: "title", attrs: { type: 'title' }, icon: '*' }, { label: t('form_builder.fields.title'), name: "title", attrs: { type: 'title' }, icon: '*' },
{ label: t('config_form.custom_fields.taxonomy'), name: "taxonomy", attrs: { type: 'taxonomy' }, icon: '*' }, { label: t('form_builder.fields.taxonomy'), name: "taxonomy", attrs: { type: 'taxonomy' }, icon: '*' },
{ label: t('config_form.custom_fields.address'), name: "address", attrs: { type: 'address' }, icon: '*' }, { label: t('form_builder.fields.address'), name: "address", attrs: { type: 'address' }, icon: '*' },
{ label: t('config_form.custom_fields.openhours'), name: "openhours", attrs: { type: 'openhours' }, icon: '' }, { label: t('form_builder.fields.openhours'), name: "openhours", attrs: { type: 'openhours' }, icon: '' },
{ label: t('config_form.custom_fields.separator'), name: "separator", attrs: { type: 'separator' }, icon: '' }, { label: t('form_builder.fields.separator'), name: "separator", attrs: { type: 'separator' }, icon: '' },
{ label: t('config_form.custom_fields.checkbox'), name: "checkbox", attrs: { type: 'checkbox' }, icon: '' }, { label: t('form_builder.fields.checkbox'), name: "checkbox", attrs: { type: 'checkbox' }, icon: '' },
{ label: t('config_form.custom_fields.email'), name: "email", attrs: { type: 'email' }, icon: '@' }, { label: t('form_builder.fields.email'), name: "email", attrs: { type: 'email' }, icon: '@' },
{ label: t('config_form.custom_fields.images'), name: "images", attrs: { type: 'images' }, icon: '' }, { label: t('form_builder.fields.images'), name: "images", attrs: { type: 'images' }, icon: '' },
{ label: t('config_form.custom_fields.files'), name: "files", attrs: { type: 'files' }, icon: '' }, { label: t('form_builder.fields.files'), name: "files", attrs: { type: 'files' }, icon: '' },
{ label: t('config_form.custom_fields.elements'), name: "elements", attrs: { type: 'elements' }, icon: '*' } { label: t('form_builder.fields.elements'), name: "elements", attrs: { type: 'elements' }, icon: '*' }
]; ];
var templates = { var templates = {
title: function(fieldData) { return { field: '<input id="' + fieldData.name + '"><span class="mandatory">' + t('config_form.custom_fields.title_help') + '</span>' }; }, title: function(fieldData) { return { field: '<input id="' + fieldData.name + '"><span class="mandatory">' + t('form_builder.fields.title_help') + '</span>' }; },
address: function(fieldData) { return { field: '<input id="' + fieldData.name + '"><span class="mandatory">' + t('config_form.custom_fields.address_help') + '</span>' }; }, address: function(fieldData) { return { field: '<input id="' + fieldData.name + '"><span class="mandatory">' + t('form_builder.fields.address_help') + '</span>' }; },
taxonomy: function(fieldData) { return { field: '<select id="' + fieldData.name + '"><option>Choisissez une catégorie principale</option></select><span class="mandatory">' + t('config_form.custom_fields.taxonomy_help') + '</span>' }; }, taxonomy: function(fieldData) { return { field: '<select id="' + fieldData.name + '"><option>Choisissez une catégorie principale</option></select><span class="mandatory">' + t('form_builder.fields.taxonomy_help') + '</span>' }; },
openhours: function(fieldData) { return { field: t('config_form.custom_fields.openhours_help') }; }, openhours: function(fieldData) { return { field: t('form_builder.fields.openhours_help') }; },
separator: function(fieldData) { return { field: '<hr>' }; }, separator: function(fieldData) { return { field: '<hr>' }; },
checkbox: function(fieldData) { return { field: '<input id="' + fieldData.name + '"' + (fieldData.defaultvalue == "yes" ? 'checked="checked"' : '') + ' type="checkbox"/>' }; }, checkbox: function(fieldData) { return { field: '<input id="' + fieldData.name + '"' + (fieldData.defaultvalue == "yes" ? 'checked="checked"' : '') + ' type="checkbox"/>' }; },
email: function(fieldData) { return { field: '<input id="' + fieldData.name + '"' + ' type="email"/><span class="mandatory">' + t('config_form.custom_fields.email_help') + '</span>' }; }, email: function(fieldData) { return { field: '<input id="' + fieldData.name + '"' + ' type="email"/><span class="mandatory">' + t('form_builder.fields.email_help') + '</span>' }; },
images: function(fieldData) { return { field: '<input id="' + fieldData.name + '"' + ' type="file" accept="images/*"/>' }; }, images: function(fieldData) { return { field: '<input id="' + fieldData.name + '"' + ' type="file" accept="images/*"/>' }; },
files: function(fieldData) { return { field: '<input id="' + fieldData.name + '"' + ' type="file" accept="'+fieldData.accept+'"/>' }; }, files: function(fieldData) { return { field: '<input id="' + fieldData.name + '"' + ' type="file" accept="'+fieldData.accept+'"/>' }; },
image: function(fieldData) { return { field: '<input id="' + fieldData.name + '"' + ' type="text"/>' }; }, image: function(fieldData) { return { field: '<input id="' + fieldData.name + '"' + ' type="text"/>' }; },
elements: function(fieldData) { return { field: '<select id="' + fieldData.name + '"><option>'+ fieldData.label+'</option></select>' }; }, elements: function(fieldData) { return { field: '<select id="' + fieldData.name + '"><option>'+ fieldData.label+'</option></select>' }; },
}; };
var iconAttr = { label: t('config_form.icon'), placeholder: t('config_form.icon_placeholder') } var iconAttr = { label: t('form_builder.icon'), placeholder: t('form_builder.icon_placeholder') }
var labelAttr = { label: t('config_form.label') } var labelAttr = { label: t('form_builder.label') }
var errorMsgAttrs = { label: t('config_form.errorMsg'), placeholder: t('config_form.errorMsg_placeholder') } var errorMsgAttrs = { label: t('form_builder.errorMsg'), placeholder: t('form_builder.errorMsg_placeholder') }
var searchAttrs = { label: t('config_form.search'), type: 'checkbox' }; var searchAttrs = { label: t('form_builder.search'), type: 'checkbox' };
var searchWeightAttrs = { label: t('config_form.searchWeigh'), type: 'number', value: "1" }; var searchWeightAttrs = { label: t('form_builder.searchWeigh'), type: 'number', value: "1" };
var patternAttrs = { label: t('config_form.pattern'), placeholder: t('config_form.pattern_placeholder') }; var patternAttrs = { label: t('form_builder.pattern'), placeholder: t('form_builder.pattern_placeholder') };
var typeUserAttrs = { var typeUserAttrs = {
text: { text: {
icon: iconAttr, icon: iconAttr,
label: labelAttr, label: labelAttr,
separator: { label: '' }, // separate important attrs from others separator: { label: '' }, // separate important attrs from others
subtype: { label: 'Type', options: { subtype: { label: 'Type', options: {
'text': t('config_form.subtype.text'), 'text': t('form_builder.subtype.text'),
'tel': t('config_form.subtype.tel'), 'tel': t('form_builder.subtype.tel'),
'email': t('config_form.subtype.email'), 'email': t('form_builder.subtype.email'),
'url': t('config_form.subtype.url') 'url': t('form_builder.subtype.url')
}, },
}, },
search: searchAttrs, search: searchAttrs,
...@@ -67,8 +67,8 @@ ...@@ -67,8 +67,8 @@
icon: iconAttr, icon: iconAttr,
label: labelAttr, label: labelAttr,
subtype: { label: 'Type', options: { subtype: { label: 'Type', options: {
'textarea': t('config_form.subtype.textarea'), 'textarea': t('form_builder.subtype.textarea'),
'wysiwyg': t('config_form.subtype.wysiwyg') 'wysiwyg': t('form_builder.subtype.wysiwyg')
}, },
}, },
search: searchAttrs, search: searchAttrs,
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
}, },
paragraph: { paragraph: {
label: { label: {
label: t('config_form.content'), label: t('form_builder.content'),
type: "textarea" type: "textarea"
} }
}, },
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
number: { icon: iconAttr, label: labelAttr, errorMsg: errorMsgAttrs }, number: { icon: iconAttr, label: labelAttr, errorMsg: errorMsgAttrs },
title: { title: {
label: labelAttr, label: labelAttr,
maxlength: { label: t('config_form.maxlength')}, maxlength: { label: t('form_builder.maxlength')},
icon: iconAttr, icon: iconAttr,
search: searchAttrs, search: searchAttrs,
searchWeight: searchWeightAttrs, searchWeight: searchWeightAttrs,
...@@ -97,8 +97,8 @@ ...@@ -97,8 +97,8 @@
address: { icon: iconAttr, label: labelAttr }, address: { icon: iconAttr, label: labelAttr },
'checkbox-group': { 'checkbox-group': {
style: { style: {
label: t('config_form.style'), label: t('form_builder.style'),
options: { 'normal': t('config_form.options.normal'), 'filled': t('config_form.options.filled') } options: { 'normal': t('form_builder.options.normal'), 'filled': t('form_builder.options.filled') }
}, },
errorMsg: errorMsgAttrs, errorMsg: errorMsgAttrs,
label: labelAttr label: labelAttr
...@@ -106,8 +106,8 @@ ...@@ -106,8 +106,8 @@
checkbox: { checkbox: {
label: labelAttr, label: labelAttr,
defaultvalue: { defaultvalue: {
label: t('config_form.defaultvalue'), label: t('form_builder.defaultvalue'),
options: { 'no': t('config_form.options.no'), 'yes': t('config_form.options.yes') } options: { 'no': t('form_builder.options.no'), 'yes': t('form_builder.options.yes') }
}, },
errorMsg: errorMsgAttrs errorMsg: errorMsgAttrs
}, },
...@@ -131,20 +131,20 @@ ...@@ -131,20 +131,20 @@
files: { files: {
icon: iconAttr, icon: iconAttr,
label: labelAttr, label: labelAttr,
accept: { label: t('config_form.accept'), placeholder: t('config_form.accept_placeholder')}, accept: { label: t('form_builder.accept'), placeholder: t('form_builder.accept_placeholder')},
separator: { label: '' }, // separate important attrs from others separator: { label: '' }, // separate important attrs from others
}, },
date: { date: {
icon: iconAttr, icon: iconAttr,
label: labelAttr, label: labelAttr,
timepicker: { label: t('config_form.timepicker'), type: 'checkbox'}, timepicker: { label: t('form_builder.timepicker'), type: 'checkbox'},
range: { label: t('config_form.range'), type: 'checkbox' }, range: { label: t('form_builder.range'), type: 'checkbox' },
}, },
elements: { elements: {
label: labelAttr, label: labelAttr,
icon: iconAttr, icon: iconAttr,
reversedBy: { label: t('config_form.reversedBy'), placeholder: t('config_form.reversedBy_placeholder') }, reversedBy: { label: t('form_builder.reversedBy'), placeholder: t('form_builder.reversedBy_placeholder') },
multiple: { label: t('config_form.multiple'), type: 'checkbox' }, multiple: { label: t('form_builder.multiple'), type: 'checkbox' },
separator: { label: '' }, // separate important attrs from others separator: { label: '' }, // separate important attrs from others
} }
}; };
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
controlOrder: ['text', 'email', 'images', 'textarea', 'checkbox', 'checkbox-group', 'radio-group', 'select', 'date', 'number', 'files', 'elements'], controlOrder: ['text', 'email', 'images', 'textarea', 'checkbox', 'checkbox-group', 'radio-group', 'select', 'date', 'number', 'files', 'elements'],
disabledAttrs: ['className', 'inline', 'toggle', 'description', 'other', 'multiple'], disabledAttrs: ['className', 'inline', 'toggle', 'description', 'other', 'multiple'],
formData: {{ formData|json_encode|raw }}, formData: {{ formData|json_encode|raw }},
roles: { 1: t('config_form.roles.1') }, roles: { 1: t('form_builder.roles.1') },
typeUserAttrs: typeUserAttrs typeUserAttrs: typeUserAttrs
}); });
...@@ -213,7 +213,7 @@ ...@@ -213,7 +213,7 @@
}) })
} }
propNameOptions = propNameOptions.sort((a,b) => a.disabled ? 1 : -1) propNameOptions = propNameOptions.sort((a,b) => a.disabled ? 1 : -1)
propNameOptions.unshift({id: '', text: t('config_form.propNameOptions'), disabled: true}) propNameOptions.unshift({id: '', text: t('form_builder.propNameOptions'), disabled: true})
$(".fld-name:visible:not(.initialized)").select2({ $(".fld-name:visible:not(.initialized)").select2({
createSearchChoice:function(term, data) { createSearchChoice:function(term, data) {
if ($(data).filter(function() { if ($(data).filter(function() {
...@@ -234,9 +234,9 @@ ...@@ -234,9 +234,9 @@
$('#{{ form.vars.id }}').val(JSON.stringify(formBuilder.actions.getData())); $('#{{ form.vars.id }}').val(JSON.stringify(formBuilder.actions.getData()));
// Changes icons and icones helpers // Changes icons and icones helpers
$('a[type=remove].icon-cancel').attr('title', t('config_form.remove_icon')).removeClass('icon-cancel').addClass('fa fa-trash-alt'); $('a[type=remove].icon-cancel').attr('title', t('form_builder.remove_icon')).removeClass('icon-cancel').addClass('fa fa-trash-alt');
$('a[type=copy].icon-copy').attr('title', t('config_form.copy_icon')); $('a[type=copy].icon-copy').attr('title', t('form_builder.copy_icon'));
$('a[type=edit].icon-pencil').attr('title', t('config_form.edit_icon')); $('a[type=edit].icon-pencil').attr('title', t('form_builder.edit_icon'));
$('.email-field input[name=name]').val('email'); $('.email-field input[name=name]').val('email');
$('.images-field input[name=name]').val('images'); $('.images-field input[name=name]').val('images');
......
...@@ -2,7 +2,7 @@ element_form: ...@@ -2,7 +2,7 @@ element_form:
geocoded_marker_text: Déplacez moi pour préciser la position</br>(au centre du bâtiment) geocoded_marker_text: Déplacez moi pour préciser la position</br>(au centre du bâtiment)
geocode_error: Erreur lors de la géolocalisation de "{address}" geocode_error: Erreur lors de la géolocalisation de "{address}"
config_form: #templates/admin/core_custom/custom-fields/form-builder.html.twig form_builder: #templates/admin/core_custom/custom-fields/form-builder.html.twig
icon: 'Icône' icon: 'Icône'
icon_placeholder: "Choisissez une icône" icon_placeholder: "Choisissez une icône"
remove_icon: "Supprimer" remove_icon: "Supprimer"
...@@ -41,7 +41,7 @@ config_form: #templates/admin/core_custom/custom-fields/form-builder.html.twig ...@@ -41,7 +41,7 @@ config_form: #templates/admin/core_custom/custom-fields/form-builder.html.twig
filled: "Plein" filled: "Plein"
no: "Non cochée" no: "Non cochée"
yes: "Cochée" yes: "Cochée"
custom_fields: fields:
title: "Titre de la fiche (obligatoire)" title: "Titre de la fiche (obligatoire)"
title_help: "Ce champ est indispensable" title_help: "Ce champ est indispensable"
taxonomy: "Catégories (obligatoire)" taxonomy: "Catégories (obligatoire)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment