Make default form fields translatable

This commit is contained in:
Jay Trees 2022-03-22 16:40:02 +01:00
parent 3042fb3878
commit 1604a1834c
2 changed files with 86 additions and 29 deletions

View file

@ -96,6 +96,36 @@ $(function() {
$.fn.toast.settings.showIcon = true;
$.fn.toast.settings.title = text.modal_success_title;
/** Form Prompts */
$.fn.form.settings.prompt = {
empty : text.form_prompt.empty,
checked : text.form_prompt.checked,
email : text.form_prompt.email,
url : text.form_prompt.url,
regExp : text.form_prompt.regExp,
integer : text.form_prompt.integer,
decimal : text.form_prompt.decimal,
number : text.form_prompt.number,
is : text.form_prompt.is,
isExactly : text.form_prompt.isExactly,
not : text.form_prompt.not,
notExactly : text.form_prompt.notExactly,
contain : text.form_prompt.contain,
containExactly : text.form_prompt.containExactly,
doesntContain : text.form_prompt.doesntContain,
doesntContainExactly : text.form_prompt.doesntContainExactly,
minLength : text.form_prompt.minLength,
length : text.form_prompt.length,
exactLength : text.form_prompt.exactLength,
maxLength : text.form_prompt.maxLength,
match : text.form_prompt.match,
different : text.form_prompt.different,
creditCard : text.form_prompt.creditCard,
minCount : text.form_prompt.minCount,
exactCount : text.form_prompt.exactCount,
maxCount : text.form_prompt.maxCount,
};
/**
* Menu
*/

View file

@ -232,42 +232,69 @@ class Page
<script type="text/javascript">
var $_GET = JSON.parse('<?= isset($_GET) ? json_encode($_GET) : array() ?>');
var text = {
wishlist_no_selection : '<?= __('No wishlist selected.') ?>',
wishlist_no_selection : '<?= __('No wishlist selected.') ?>',
modal_failure_approve : '<?= __('Thanks for nothing') ?>',
modal_warning_approve : '<?= __('Understood') ?>',
modal_success_title : '<?= __('Success') ?>',
modal_failure_approve : '<?= __('Thanks for nothing') ?>',
modal_warning_approve : '<?= __('Understood') ?>',
modal_success_title : '<?= __('Success') ?>',
modal_wishlist_warning_approve: '<?= __('Close this tab') ?>',
modal_wishlist_warning_deny : '<?= __('Show wishlist anyway') ?>',
modal_wishlist_delete_title : '<?= __('Really delete?') ?>',
modal_wishlist_delete : '<?= sprintf(__('Do you really want to delete the wishlist %s?'), '<strong>WISHLIST_NAME</strong>') ?>',
modal_wishlist_delete_approve : '<?= __('Yes, delete') ?>',
modal_wishlist_delete_deny : '<?= __('No, keep') ?>',
modal_wishlist_warning_approve : '<?= __('Close this tab') ?>',
modal_wishlist_warning_deny : '<?= __('Show wishlist anyway') ?>',
modal_wishlist_delete_title : '<?= __('Really delete?') ?>',
modal_wishlist_delete : '<?= sprintf(__('Do you really want to delete the wishlist %s?'), '<strong>WISHLIST_NAME</strong>') ?>',
modal_wishlist_delete_approve : '<?= __('Yes, delete') ?>',
modal_wishlist_delete_deny : '<?= __('No, keep') ?>',
modal_wish_commit_title : '<?= __('Really commit?') ?>',
modal_wish_commit : '<?= __('Would you really like to commit to this purchase? It will no longer appear in the wishlist for others anymore.') ?>',
modal_wish_commit_approve : '<?= __('Yes, commit') ?>',
modal_wish_commit_deny : '<?= __('Cancel') ?>',
modal_wish_delete_title : '<?= __('Really delete?') ?>',
modal_wish_delete : '<?= __('Would you really like to delete to this wish? It will be gone forever.') ?>',
modal_wish_delete_approve : '<?= __('Yes, delete') ?>',
modal_wish_delete_deny : '<?= __('No, keep') ?>',
modal_wish_commit_title : '<?= __('Really commit?') ?>',
modal_wish_commit : '<?= __('Would you really like to commit to this purchase? It will no longer appear in the wishlist for others anymore.') ?>',
modal_wish_commit_approve : '<?= __('Yes, commit') ?>',
modal_wish_commit_deny : '<?= __('Cancel') ?>',
modal_wish_delete_title : '<?= __('Really delete?') ?>',
modal_wish_delete : '<?= __('Would you really like to delete to this wish? It will be gone forever.') ?>',
modal_wish_delete_approve : '<?= __('Yes, delete') ?>',
modal_wish_delete_deny : '<?= __('No, keep') ?>',
form_profile_password : '<?= __('Password must match.') ?>',
form_profile_password : '<?= __('Password must match.') ?>',
toast_wishlist_rename : '<?= __('Wishlist successfully renamed.') ?>',
toast_wishlist_delete : '<?= __('Wishlist successfully deleted.') ?>',
toast_wishlist_rename : '<?= __('Wishlist successfully renamed.') ?>',
toast_wishlist_delete : '<?= __('Wishlist successfully deleted.') ?>',
toast_wish_create : '<?= __('Wish successfully created.') ?>',
toast_wish_add : '<?= __('Wish successfully added.') ?>',
toast_wish_update : '<?= __('Wish information updated.') ?>',
toast_wish_save : '<?= __(addslashes('Don\'t forget to save your changes.')) ?>',
toast_wish_delete : '<?= __('Wish successfully deleted.') ?>',
toast_wish_create : '<?= __('Wish successfully created.') ?>',
toast_wish_add : '<?= __('Wish successfully added.') ?>',
toast_wish_update : '<?= __('Wish information updated.') ?>',
toast_wish_save : '<?= __(addslashes('Don\'t forget to save your changes.')) ?>',
toast_wish_delete : '<?= __('Wish successfully deleted.') ?>',
toast_clipboard_error_title : '<?= __('Error') ?>',
toast_clipboard_error : '<?= __('Unable to copy to clipboard. There is likely a permission issue.') ?>',
toast_clipboard_success : '<?= __('Link copied to clipboard.') ?>',
toast_clipboard_error_title : '<?= __('Error') ?>',
toast_clipboard_error : '<?= __('Unable to copy to clipboard. There is likely a permission issue.') ?>',
toast_clipboard_success : '<?= __('Link copied to clipboard.') ?>',
form_prompt_empty : '<?= __('{name} must have a value') ?>',
form_prompt_checked : '<?= __('{name} must be checked') ?>',
form_prompt_email : '<?= __('{name} must be a valid e-mail') ?>',
form_prompt_url : '<?= __('{name} must be a valid url') ?>',
form_prompt_regExp : '<?= __('{name} is not formatted correctly') ?>',
form_prompt_integer : '<?= __('{name} must be an integer') ?>',
form_prompt_decimal : '<?= __('{name} must be a decimal number') ?>',
form_prompt_number : '<?= __('{name} must be set to a number') ?>',
form_prompt_is : '<?= __('{name} must be \'{ruleValue}\'') ?>',
form_prompt_isExactly : '<?= __('{name} must be exactly \'{ruleValue}\'') ?>',
form_prompt_not : '<?= __('{name} cannot be set to \'{ruleValue}\'') ?>',
form_prompt_notExactly : '<?= __('{name} cannot be set to exactly \'{ruleValue}\'') ?>',
form_prompt_contain : '<?= __('{name} cannot contain \'{ruleValue}\'') ?>',
form_prompt_containExactly : '<?= __('{name} cannot contain exactly \'{ruleValue}\'') ?>',
form_prompt_doesntContain : '<?= __('{name} must contain \'{ruleValue}\'') ?>',
form_prompt_doesntContainExactly : '<?= __('{name} must contain exactly \'{ruleValue}\'') ?>',
form_prompt_minLength : '<?= __('{name} must be at least {ruleValue} characters') ?>',
form_prompt_length : '<?= __('{name} must be at least {ruleValue} characters') ?>',
form_prompt_exactLength : '<?= __('{name} must be exactly {ruleValue} characters') ?>',
form_prompt_maxLength : '<?= __('{name} cannot be longer than {ruleValue} characters') ?>',
form_prompt_match : '<?= __('{name} must match {ruleValue} field') ?>',
form_prompt_different : '<?= __('{name} must have a different value than {ruleValue} field') ?>',
form_prompt_creditCard : '<?= __('{name} must be a valid credit card number') ?>',
form_prompt_minCount : '<?= __('{name} must have at least {ruleValue} choices') ?>',
form_prompt_exactCount : '<?= __('{name} must have exactly {ruleValue} choices') ?>',
form_prompt_maxCount : '<?= __('{name} must have {ruleValue} or less choices') ?>',
};
</script>
<?php