简体   繁体   English

我如何获得Parsley.js的语言环境

[英]How can I get the locale of Parsley.js

While defining Parsley's locale in the backend like this: 后端中定义Parsley的语言环境时,如下所示:

Parsley.setLocale('de');

How can I get the locale value ('de' for example) in the front-end using javascript/jquery? 如何使用javascript / jquery 在前端获取语​​言环境值(例如'de')?

I tried a function like getLocale()... but it doesn't seems to work. 我尝试了类似getLocale()的函数,但是它似乎不起作用。

NOTE: I dont have access to the backend. 注意:我无权访问后端。

<script src="jquery.js"></script>
<script src="i18n/fr.js"></script>
<script src="i18n/it.js"></script>
<script src="parsley.min.js"></script>
<script type="text/javascript">
   window.ParsleyValidator.setLocale('fr');
</script>

Source 资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM