Merge pull request #338 from litvinovg/autocomplete_form

[i18n sprint] Language-neutral help text in autocomplete forms
This commit is contained in:
Dragan Ivanovic 2022-10-27 15:08:05 +02:00 committed by GitHub
commit 1511e00c61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -125,7 +125,7 @@ Also multiple types parameter set to true only if more than one type returned-->
};
var i18nStrings = {
selectAnExisting: '${i18n().select_an_existing?js_string}',
orCreateNewOne: '${i18n().or_create_new_one?js_string}',
selectAnExistingOrCreateNewOne: '${i18n().select_an_existing_or_create_a_new_one?js_string}',
selectedString: '${i18n().selected?js_string}'
};
</script>

View file

@ -695,10 +695,10 @@ var customForm = {
// ac fields there are cases where we also have to check if the help text is already there
if (!$(selectedObj).val() || $(selectedObj).hasClass(this.acHelpTextClass) || $(selectedObj).val().substring(0, 18) == customForm.selectAnExisting ) {
typeText = this.getTypeNameForLabels($(selectedObj));
var helpText = customForm.selectAnExisting + " " + typeText + " " + customForm.orCreateNewOne ;
var helpText = customForm.selectAnExistingOrCreateNewOne ;
//Different for object property autocomplete
if ( this.acSelectOnly ) {
helpText = customForm.selectAnExisting + " " + typeText;
helpText = customForm.selectAnExisting;
}
$(selectedObj).val(helpText)
.addClass(this.acHelpTextClass);