Prestashop 验证时更改描述错误
Prestashop Change description error on validation
我想更改此错误的描述:
有1个错误
地址 1 无效。
« 返回
我想从 "is invalid" 更改为 "is invalid. Address field must not contain @, #, % and other"
我搜索了文件,显示错误。 (./themes/default-bootstrap/errors.tpl)
{if isset($errors) && $errors}
<div class="alert alert-danger">
<p>{if $errors|@count > 1}{l s='There are %d errors' sprintf=$errors|@count}{else}{l s='There is %d error' sprintf=$errors|@count}{/if}</p>
<ol>
{foreach from=$errors key=k item=error}
<li>{$error}</li>
{/foreach}
</ol>
{if isset($smarty.server.HTTP_REFERER) && !strstr($request_uri, 'authentication') && preg_replace('#^https?://[^/]+/#', '/', $smarty.server.HTTP_REFERER) != $request_uri}
<p class="lnk"><a href="{$smarty.server.HTTP_REFERER|escape:'html':'UTF-8'|secureReferrer}" title="{l s='Back'}">« {l s='Back'}</a></p>
{/if}
</div>
{/if}
和验证(./js/validate.js)
function validate_isAddress(s)
{
var reg = /^[^!<>?=+@{}_$%]+$/;
return reg.test(s);
}
和Address.tpl (./themes/default-bootstrap/address.tpl)
<p class="required text">
<label for="address1">{l s='Address'}</label>
<input class="text" data-validate="{$address_validation.$field_name.validate}" type="text" id="address1" name="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{else}{if isset($address->address1)}{$address->address1|escape:'html':'UTF-8'}{/if}{/if}">
<sup>*</sup>
</p>
但是我没有找到修改错误描述的文件
您可以在 Prestashop 后台更改所有错误语句
转到您的 Prestashop 后台:
本地化->翻译
在select选项框中,select"error message translations"那里可以调整整个网站的所有错误信息。
最好这样做而不是更改一些核心 Prestashop 文件。
错误信息调整画面
我想更改此错误的描述:
有1个错误 地址 1 无效。 « 返回
我想从 "is invalid" 更改为 "is invalid. Address field must not contain @, #, % and other"
我搜索了文件,显示错误。 (./themes/default-bootstrap/errors.tpl)
{if isset($errors) && $errors}
<div class="alert alert-danger">
<p>{if $errors|@count > 1}{l s='There are %d errors' sprintf=$errors|@count}{else}{l s='There is %d error' sprintf=$errors|@count}{/if}</p>
<ol>
{foreach from=$errors key=k item=error}
<li>{$error}</li>
{/foreach}
</ol>
{if isset($smarty.server.HTTP_REFERER) && !strstr($request_uri, 'authentication') && preg_replace('#^https?://[^/]+/#', '/', $smarty.server.HTTP_REFERER) != $request_uri}
<p class="lnk"><a href="{$smarty.server.HTTP_REFERER|escape:'html':'UTF-8'|secureReferrer}" title="{l s='Back'}">« {l s='Back'}</a></p>
{/if}
</div>
{/if}
和验证(./js/validate.js)
function validate_isAddress(s)
{
var reg = /^[^!<>?=+@{}_$%]+$/;
return reg.test(s);
}
和Address.tpl (./themes/default-bootstrap/address.tpl)
<p class="required text">
<label for="address1">{l s='Address'}</label>
<input class="text" data-validate="{$address_validation.$field_name.validate}" type="text" id="address1" name="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{else}{if isset($address->address1)}{$address->address1|escape:'html':'UTF-8'}{/if}{/if}">
<sup>*</sup>
</p>
但是我没有找到修改错误描述的文件
您可以在 Prestashop 后台更改所有错误语句 转到您的 Prestashop 后台:
本地化->翻译
在select选项框中,select"error message translations"那里可以调整整个网站的所有错误信息。
最好这样做而不是更改一些核心 Prestashop 文件。
错误信息调整画面