---
title: "bootstrapvalidator 使用语言包"
author: "gary_bu"
date: "2015-12-03T22:38:51Z"
tags: []
categories: ["Web前端"]
slug: "bootstrapvalidator"
draft: false
lastmod: "2015-12-03T22:38:51Z"
id: 2261556
url: "https://gary-bu.iteye.com/blog/2261556"
---

BootstrapValidator 的验证功能还是很强大的,只是验证后提示的信息默认是英文的，能不能提示中文呢？肯定可以，否则也太。。。啥了吧  
去 http://bv.doc.javake.cn/ 网站下载bootstrapvalidator资源包，里面有各国语言文件，在jqcool.net-bootstrapvalidator\\dist\\js\\language下

jqcool.net-bootstrapvalidator\\demo 有很多例子，其中有一个i18n.html的文件就一个教如何使用语言包的。

在http://bootstrapvalidator.votintsev.ru/examples/using-language-package/ 提供了在线的例子也做了说明：

First, including the language package, right after the plugin script:

```
<script type="text/javascript" src="/path/to/dist/js/bootstrapValidator.js"></script>
<script type="text/javascript" src="/path/to/dist/js/language/languagecode_COUNTRYCODE.js"></script>
```

   
When calling the plugin, .bootstrapValidator(), just don't set the message option. The messages then are taken from the translation package.

红色的部分注意一下就好。