Browse Source

#385: Support i18n. Provide the Vietnamese language file

nghuuphuoc 11 years ago
parent
commit
b45b8c645f
6 changed files with 1115 additions and 173 deletions
  1. 1 1
      CHANGELOG.md
  2. 2 1
      Gruntfile.js
  3. 317 0
      demo/defaultMessage.html
  4. 155 171
      demo/i18n.html
  5. 320 0
      dist/js/languages/vi_VN.js
  6. 320 0
      src/js/languages/vi_VN.js

+ 1 - 1
CHANGELOG.md

@@ -4,7 +4,7 @@
 
 __New Features__
 * [#2](https://github.com/nghuuphuoc/bootstrapvalidator/issues/2), [#387](https://github.com/nghuuphuoc/bootstrapvalidator/issues/387): Provide the default error messages
-* [#93](https://github.com/nghuuphuoc/bootstrapvalidator/issues/93), [#385](https://github.com/nghuuphuoc/bootstrapvalidator/issues/385): Support translating error messages
+* [#93](https://github.com/nghuuphuoc/bootstrapvalidator/issues/93), [#385](https://github.com/nghuuphuoc/bootstrapvalidator/issues/385): Support translating error messages. Provide the Vietnamese language file
 * [#121](https://github.com/nghuuphuoc/bootstrapvalidator/issues/121): Add events for form validate successfully or not
 * [#125](https://github.com/nghuuphuoc/bootstrapvalidator/issues/125): Support dynamic fields
 * [#130](https://github.com/nghuuphuoc/bootstrapvalidator/pull/130): Add ```addField()``` and ```removeField()``` methods for managing dynamic fields, thanks to [@jcnmulio](https://github.com/jcnmulio)

+ 2 - 1
Gruntfile.js

@@ -20,7 +20,8 @@ module.exports = function(grunt) {
         copy: {
             main: {
                 files: [
-                    { cwd: 'src/css', src: '**', dest: '<%= buildDir %>/css', expand: true, flatten: true, filter: 'isFile' }
+                    { cwd: 'src/css', src: '**', dest: '<%= buildDir %>/css', expand: true, flatten: true, filter: 'isFile' },
+                    { cwd: 'src/js/languages', src: '**', dest: '<%= buildDir %>/js/languages', expand: true, flatten: true, filter: 'isFile' }
                 ]
             }
         },

+ 317 - 0
demo/defaultMessage.html

@@ -0,0 +1,317 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>BootstrapValidator demo</title>
+
+    <link rel="stylesheet" href="../vendor/bootstrap/css/bootstrap.css"/>
+    <link rel="stylesheet" href="../dist/css/bootstrapValidator.css"/>
+
+    <script type="text/javascript" src="../vendor/jquery/jquery-1.10.2.min.js"></script>
+    <script type="text/javascript" src="../vendor/bootstrap/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="../dist/js/bootstrapValidator.js"></script>
+</head>
+<body>
+    <div class="container">
+        <div class="row">
+            <div class="col-lg-8 col-lg-offset-2">
+                <div class="page-header">
+                    <h2>Default messages</h2>
+                </div>
+
+                <form id="defaultForm" method="post" class="form-horizontal" action="target.php">
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Full name</label>
+                        <div class="col-lg-4">
+                            <input type="text" class="form-control" name="firstName" placeholder="First name" />
+                        </div>
+                        <div class="col-lg-4">
+                            <input type="text" class="form-control" name="lastName" placeholder="Last name" />
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Username</label>
+                        <div class="col-lg-5">
+                            <input type="text" class="form-control" name="username" />
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Email address</label>
+                        <div class="col-lg-5">
+                            <input type="text" class="form-control" name="email" />
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Password</label>
+                        <div class="col-lg-5">
+                            <input type="password" class="form-control" name="password" />
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Retype password</label>
+                        <div class="col-lg-5">
+                            <input type="password" class="form-control" name="confirmPassword" />
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Gender</label>
+                        <div class="col-lg-5">
+                            <div class="radio">
+                                <label>
+                                    <input type="radio" name="gender" value="male" /> Male
+                                </label>
+                            </div>
+                            <div class="radio">
+                                <label>
+                                    <input type="radio" name="gender" value="female" /> Female
+                                </label>
+                            </div>
+                            <div class="radio">
+                                <label>
+                                    <input type="radio" name="gender" value="other" /> Other
+                                </label>
+                            </div>
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Age</label>
+                        <div class="col-lg-3">
+                            <input type="text" class="form-control" name="age" />
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Website</label>
+                        <div class="col-lg-5">
+                            <input type="text" class="form-control" name="website" />
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Phone number</label>
+                        <div class="col-lg-5">
+                            <input type="text" class="form-control" name="phoneNumber" />
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Languages</label>
+                        <div class="col-lg-5">
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="languages[]" value="english" /> English
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="languages[]" value="french" /> French
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="languages[]" value="german" /> German
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="languages[]" value="russian" /> Russian
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="languages[]" value="other" /> Other
+                                </label>
+                            </div>
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Programming Languages</label>
+                        <div class="col-lg-5">
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="net" /> .Net
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="java" /> Java
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="c" /> C/C++
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="php" /> PHP
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="perl" /> Perl
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="ruby" /> Ruby
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="python" /> Python
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="javascript" /> Javascript
+                                </label>
+                            </div>
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <div class="col-lg-9 col-lg-offset-3">
+                            <button type="submit" class="btn btn-primary" name="signup" value="Sign up">Sign up</button>
+                            <button type="submit" class="btn btn-primary" name="signup2" value="Sign up 2">Sign up 2</button>
+                        </div>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+
+<script type="text/javascript">
+$(document).ready(function() {
+    $('#defaultForm').bootstrapValidator({
+        message: 'This value is not valid',
+        feedbackIcons: {
+            valid: 'glyphicon glyphicon-ok',
+            invalid: 'glyphicon glyphicon-remove',
+            validating: 'glyphicon glyphicon-refresh'
+        },
+        fields: {
+            firstName: {
+                validators: {
+                    notEmpty: {},
+                    stringCase: {
+                        'case': 'upper'
+                    }
+                }
+            },
+            lastName: {
+                validators: {
+                    notEmpty: {},
+                    stringCase: {
+                        'case': 'upper'
+                    }
+                }
+            },
+            username: {
+                message: 'The username is not valid',
+                validators: {
+                    notEmpty: {},
+                    stringLength: {
+                        min: 6,
+                        max: 20
+                    },
+                    regexp: {
+                        regexp: /^[a-zA-Z0-9_\.]+$/
+                    },
+                    remote: {
+                        url: 'remote.php',
+                        message: 'The username is not available'
+                    },
+                    different: {
+                        field: 'password',
+                        message: 'The username and password cannot be the same as each other'
+                    }
+                }
+            },
+            email: {
+                validators: {
+                    emailAddress: {}
+                }
+            },
+            password: {
+                validators: {
+                    notEmpty: {},
+                    identical: {
+                        field: 'confirmPassword',
+                        message: 'The password and its confirm are not the same'
+                    },
+                    different: {
+                        field: 'username',
+                        message: 'The password cannot be the same as username'
+                    }
+                }
+            },
+            confirmPassword: {
+                validators: {
+                    notEmpty: {},
+                    identical: {
+                        field: 'password'
+                    },
+                    different: {
+                        field: 'username',
+                        message: 'The password cannot be the same as username'
+                    }
+                }
+            },
+            age: {
+                validators: {
+                    notEmpty: {},
+                    digits: {},
+                    greaterThan: {
+                        value: 18
+                    },
+                    lessThan: {
+                        value: 100
+                    }
+                }
+            },
+            website: {
+                validators: {
+                    notEmpty: {},
+                    uri: {}
+                }
+            },
+            phoneNumber: {
+                validators: {
+                    notEmpty: {},
+                    digits: {},
+                    phone: {
+                        country: 'US'
+                    }
+                }
+            },
+            gender: {
+                validators: {
+                    notEmpty: {}
+                }
+            },
+            'languages[]': {
+                validators: {
+                    notEmpty: {}
+                }
+            },
+            'programs[]': {
+                validators: {
+                    choice: {
+                        min: 2,
+                        max: 4
+                    }
+                }
+            }
+        }
+    });
+});
+</script>
+</body>
+</html>

+ 155 - 171
demo/i18n.html

@@ -9,196 +9,187 @@
     <script type="text/javascript" src="../vendor/jquery/jquery-1.10.2.min.js"></script>
     <script type="text/javascript" src="../vendor/bootstrap/js/bootstrap.min.js"></script>
     <script type="text/javascript" src="../dist/js/bootstrapValidator.js"></script>
+    <script type="text/javascript" src="../dist/js/languages/vi_VN.js"></script>
 </head>
 <body>
     <div class="container">
         <div class="row">
-            <!-- form: -->
-            <section>
-                <div class="col-lg-8 col-lg-offset-2">
-                    <div class="page-header">
-                        <h2>Default messages</h2>
-                    </div>
+            <div class="col-lg-8 col-lg-offset-2">
+                <div class="page-header">
+                    <h2>Default messages</h2>
+                </div>
 
-                    <form id="defaultForm" method="post" class="form-horizontal" action="target.php">
-                        <div class="form-group">
-                            <label class="col-lg-3 control-label">Full name</label>
-                            <div class="col-lg-4">
-                                <input type="text" class="form-control" name="firstName" placeholder="First name" />
-                            </div>
-                            <div class="col-lg-4">
-                                <input type="text" class="form-control" name="lastName" placeholder="Last name" />
-                            </div>
+                <form id="defaultForm" method="post" class="form-horizontal" action="target.php">
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Full name</label>
+                        <div class="col-lg-4">
+                            <input type="text" class="form-control" name="firstName" placeholder="First name" />
+                        </div>
+                        <div class="col-lg-4">
+                            <input type="text" class="form-control" name="lastName" placeholder="Last name" />
                         </div>
+                    </div>
 
-                        <div class="form-group">
-                            <label class="col-lg-3 control-label">Username</label>
-                            <div class="col-lg-5">
-                                <input type="text" class="form-control" name="username" />
-                            </div>
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Username</label>
+                        <div class="col-lg-5">
+                            <input type="text" class="form-control" name="username" />
                         </div>
+                    </div>
 
-                        <div class="form-group">
-                            <label class="col-lg-3 control-label">Email address</label>
-                            <div class="col-lg-5">
-                                <input type="text" class="form-control" name="email" />
-                            </div>
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Email address</label>
+                        <div class="col-lg-5">
+                            <input type="text" class="form-control" name="email" />
                         </div>
+                    </div>
 
-                        <div class="form-group">
-                            <label class="col-lg-3 control-label">Password</label>
-                            <div class="col-lg-5">
-                                <input type="password" class="form-control" name="password" />
-                            </div>
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Password</label>
+                        <div class="col-lg-5">
+                            <input type="password" class="form-control" name="password" />
                         </div>
+                    </div>
 
-                        <div class="form-group">
-                            <label class="col-lg-3 control-label">Retype password</label>
-                            <div class="col-lg-5">
-                                <input type="password" class="form-control" name="confirmPassword" />
-                            </div>
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Retype password</label>
+                        <div class="col-lg-5">
+                            <input type="password" class="form-control" name="confirmPassword" />
                         </div>
+                    </div>
 
-                        <div class="form-group">
-                            <label class="col-lg-3 control-label">Gender</label>
-                            <div class="col-lg-5">
-                                <div class="radio">
-                                    <label>
-                                        <input type="radio" name="gender" value="male" /> Male
-                                    </label>
-                                </div>
-                                <div class="radio">
-                                    <label>
-                                        <input type="radio" name="gender" value="female" /> Female
-                                    </label>
-                                </div>
-                                <div class="radio">
-                                    <label>
-                                        <input type="radio" name="gender" value="other" /> Other
-                                    </label>
-                                </div>
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Gender</label>
+                        <div class="col-lg-5">
+                            <div class="radio">
+                                <label>
+                                    <input type="radio" name="gender" value="male" /> Male
+                                </label>
+                            </div>
+                            <div class="radio">
+                                <label>
+                                    <input type="radio" name="gender" value="female" /> Female
+                                </label>
+                            </div>
+                            <div class="radio">
+                                <label>
+                                    <input type="radio" name="gender" value="other" /> Other
+                                </label>
                             </div>
                         </div>
+                    </div>
 
-                        <div class="form-group">
-                            <label class="col-lg-3 control-label">Age</label>
-                            <div class="col-lg-3">
-                                <input type="text" class="form-control" name="age" />
-                            </div>
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Age</label>
+                        <div class="col-lg-3">
+                            <input type="text" class="form-control" name="age" />
                         </div>
+                    </div>
 
-                        <div class="form-group">
-                            <label class="col-lg-3 control-label">Phone number</label>
-                            <div class="col-lg-3">
-                                <input type="text" class="form-control" name="phoneNumber" />
-                            </div>
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Website</label>
+                        <div class="col-lg-5">
+                            <input type="text" class="form-control" name="website" />
                         </div>
+                    </div>
 
-                        <div class="form-group">
-                            <label class="col-lg-3 control-label">Languages</label>
-                            <div class="col-lg-5">
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="languages[]" value="english" /> English
-                                    </label>
-                                </div>
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="languages[]" value="french" /> French
-                                    </label>
-                                </div>
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="languages[]" value="german" /> German
-                                    </label>
-                                </div>
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="languages[]" value="russian" /> Russian
-                                    </label>
-                                </div>
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="languages[]" value="other" /> Other
-                                    </label>
-                                </div>
-                            </div>
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Phone number</label>
+                        <div class="col-lg-5">
+                            <input type="text" class="form-control" name="phoneNumber" />
                         </div>
+                    </div>
 
-                        <div class="form-group">
-                            <label class="col-lg-3 control-label">Programming Languages</label>
-                            <div class="col-lg-5">
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="programs[]" value="net" /> .Net
-                                    </label>
-                                </div>
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="programs[]" value="java" /> Java
-                                    </label>
-                                </div>
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="programs[]" value="c" /> C/C++
-                                    </label>
-                                </div>
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="programs[]" value="php" /> PHP
-                                    </label>
-                                </div>
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="programs[]" value="perl" /> Perl
-                                    </label>
-                                </div>
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="programs[]" value="ruby" /> Ruby
-                                    </label>
-                                </div>
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="programs[]" value="python" /> Python
-                                    </label>
-                                </div>
-                                <div class="checkbox">
-                                    <label>
-                                        <input type="checkbox" name="programs[]" value="javascript" /> Javascript
-                                    </label>
-                                </div>
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Languages</label>
+                        <div class="col-lg-5">
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="languages[]" value="english" /> English
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="languages[]" value="french" /> French
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="languages[]" value="german" /> German
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="languages[]" value="russian" /> Russian
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="languages[]" value="other" /> Other
+                                </label>
                             </div>
                         </div>
+                    </div>
 
-                        <div class="form-group">
-                            <label class="col-lg-3 control-label" id="captchaOperation"></label>
-                            <div class="col-lg-2">
-                                <input type="text" class="form-control" name="captcha" />
+                    <div class="form-group">
+                        <label class="col-lg-3 control-label">Programming Languages</label>
+                        <div class="col-lg-5">
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="net" /> .Net
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="java" /> Java
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="c" /> C/C++
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="php" /> PHP
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="perl" /> Perl
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="ruby" /> Ruby
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="python" /> Python
+                                </label>
+                            </div>
+                            <div class="checkbox">
+                                <label>
+                                    <input type="checkbox" name="programs[]" value="javascript" /> Javascript
+                                </label>
                             </div>
                         </div>
+                    </div>
 
-                        <div class="form-group">
-                            <div class="col-lg-9 col-lg-offset-3">
-                                <button type="submit" class="btn btn-primary" name="signup" value="Sign up">Sign up</button>
-                                <button type="submit" class="btn btn-primary" name="signup2" value="Sign up 2">Sign up 2</button>
-                            </div>
+                    <div class="form-group">
+                        <div class="col-lg-9 col-lg-offset-3">
+                            <button type="submit" class="btn btn-primary" name="signup" value="Sign up">Sign up</button>
+                            <button type="submit" class="btn btn-primary" name="signup2" value="Sign up 2">Sign up 2</button>
                         </div>
-                    </form>
-                </div>
-            </section>
-            <!-- :form -->
+                    </div>
+                </form>
+            </div>
         </div>
     </div>
 
 <script type="text/javascript">
 $(document).ready(function() {
-    // Generate a simple captcha
-    function randomNumber(min, max) {
-        return Math.floor(Math.random() * (max - min + 1) + min);
-    };
-    $('#captchaOperation').html([randomNumber(1, 100), '+', randomNumber(1, 200), '='].join(' '));
-
     $('#defaultForm').bootstrapValidator({
         message: 'This value is not valid',
         feedbackIcons: {
@@ -224,7 +215,6 @@ $(document).ready(function() {
                 }
             },
             username: {
-                message: 'The username is not valid',
                 validators: {
                     notEmpty: {},
                     stringLength: {
@@ -236,7 +226,7 @@ $(document).ready(function() {
                     },
                     remote: {
                         url: 'remote.php',
-                        message: 'The username is not available'
+                        message: 'Tên tài khoản này đã được đăng ký'
                     },
                     different: {
                         field: 'password',
@@ -253,12 +243,11 @@ $(document).ready(function() {
                 validators: {
                     notEmpty: {},
                     identical: {
-                        field: 'confirmPassword',
-                        message: 'The password and its confirm are not the same'
+                        field: 'confirmPassword'
                     },
                     different: {
                         field: 'username',
-                        message: 'The password cannot be the same as username'
+                        message: 'Mật khẩu và tên đăng nhập phải khác nhau'
                     }
                 }
             },
@@ -270,7 +259,7 @@ $(document).ready(function() {
                     },
                     different: {
                         field: 'username',
-                        message: 'The password cannot be the same as username'
+                        message: 'Mật khẩu và tên đăng nhập phải khác nhau'
                     }
                 }
             },
@@ -286,6 +275,12 @@ $(document).ready(function() {
                     }
                 }
             },
+            website: {
+                validators: {
+                    notEmpty: {},
+                    uri: {}
+                }
+            },
             phoneNumber: {
                 validators: {
                     notEmpty: {},
@@ -312,17 +307,6 @@ $(document).ready(function() {
                         max: 4
                     }
                 }
-            },
-            captcha: {
-                validators: {
-                    callback: {
-                        message: 'Wrong answer',
-                        callback: function(value, validator) {
-                            var items = $('#captchaOperation').html().split(' '), sum = parseInt(items[0]) + parseInt(items[2]);
-                            return value == sum;
-                        }
-                    }
-                }
             }
         }
     });

+ 320 - 0
dist/js/languages/vi_VN.js

@@ -0,0 +1,320 @@
+(function($) {
+    $.fn.bootstrapValidator.i18n = $.extend(true, $.fn.bootstrapValidator.i18n, {
+        base64: {
+            'default': 'Vui lòng nhập chuỗi mã hoá base64 hợp lệ'
+        },
+        between: {
+            'default': 'Vui lòng nhập giá trị nằm giữa %s và %s',
+            notInclusive: 'Vui lòng nhập giá trị nằm giữa %s và %s'
+        },
+        callback: {
+            'default': 'Vui lòng nhập giá trị hợp lệ'
+        },
+        choice: {
+            'default': 'Vui lòng nhập giá trị hợp lệ',
+            less: 'Vui lòng chọn ít nhất %s lựa chọn',
+            more: 'Vui lòng chọn nhiều nhất %s lựa chọn',
+            between: 'Vui lòng chọn %s - %s lựa chọn',
+        },
+        creditCard: {
+            'default': 'Vui lòng nhập số thẻ tín dụng hợp lệ'
+        },
+        cusip: {
+            'default': 'Vui lòng nhập số CUSIP hợp lệ'
+        },
+        cvv: {
+            'default': 'Vui lòng nhập số CVV hợp lệ'
+        },
+        date: {
+            'default': 'Vui lòng nhập ngày hợp lệ'
+        },
+        different: {
+            'default': 'Vui lòng nhập một giá trị khác'
+        },
+        digits: {
+             'default': 'Vui lòng chỉ nhập số'
+        },
+        ean: {
+            'default': 'Vui lòng nhập số EAN hợp lệ'
+        },
+        emailAddress: {
+            'default': 'Vui lòng nhập địa chỉ email hợp lệ'
+        },
+        file: {
+            'default': 'Vui lòng chọn file hợp lệ'
+        },
+        greaterThan: {
+            'default': 'Vui lòng nhập giá trị lớn hơn hoặc bằng %s',
+            notInclusive: 'Vui lòng nhập giá trị lớn hơn %s'
+        },
+        grid: {
+            'default': 'Vui lòng nhập số GRId hợp lệ'
+        },
+        hex: {
+            'default': 'Vui lòng nhập số hexa hợp lệ'
+        },
+        hexColor: {
+            'default': 'Vui lòng nhập mã màu hợp lệ'
+        },
+        iban: {
+            'default': 'Vui lòng nhập số IBAN hợp lệ',
+            countryNotSupported: 'Mã quốc gia %s không được hỗ trợ',
+            country: 'Vui lòng nhập mã IBAN hợp lệ của %s',
+            countries: {
+                AD: 'Andorra',
+                AE: 'Tiểu vương quốc Ả Rập thống nhất',
+                AL: 'Albania',
+                AO: 'Angola',
+                AT: 'Áo',
+                AZ: 'Azerbaijan',
+                BA: 'Bosnia và Herzegovina',
+                BE: 'Bỉ',
+                BF: 'Burkina Faso',
+                BG: 'Bulgaria',
+                BH: 'Bahrain',
+                BI: 'Burundi',
+                BJ: 'Benin',
+                BR: 'Brazil',
+                CH: 'Thuỵ Sĩ',
+                CI: 'Bờ Biển Ngà',
+                CM: 'Cameroon',
+                CR: 'Costa Rica',
+                CV: 'Cape Verde',
+                CY: 'Síp',
+                CZ: 'Séc',
+                DE: 'Đức',
+                DK: 'Đan Mạch',
+                DO: 'Dominican',
+                DZ: 'Algeria',
+                EE: 'Estonia',
+                ES: 'Tây Ban Nha',
+                FI: 'Phần Lan',
+                FO: 'đảo Faroe',
+                FR: 'Pháp',
+                GB: 'Vương quốc Anh',
+                GE: 'Georgia',
+                GI: 'Gibraltar',
+                GL: 'Greenland',
+                GR: 'Hy Lạp',
+                GT: 'Guatemala',
+                HR: 'Croatia',
+                HU: 'Hungary',
+                IE: 'Ireland',
+                IL: 'Israel',
+                IR: 'Iran',
+                IS: 'Iceland',
+                IT: 'Ý',
+                JO: 'Jordan',
+                KW: 'Kuwait',
+                KZ: 'Kazakhstan',
+                LB: 'Lebanon',
+                LI: 'Liechtenstein',
+                LT: 'Lithuania',
+                LU: 'Luxembourg',
+                LV: 'Latvia',
+                MC: 'Monaco',
+                MD: 'Moldova',
+                ME: 'Montenegro',
+                MG: 'Madagascar',
+                MK: 'Macedonia',
+                ML: 'Mali',
+                MR: 'Mauritania',
+                MT: 'Malta',
+                MU: 'Mauritius',
+                MZ: 'Mozambique',
+                NL: 'Hà Lan',
+                NO: 'Na Uy',
+                PK: 'Pakistan',
+                PL: 'Ba Lan',
+                PS: 'Palestinian',
+                PT: 'Bồ Đào Nha',
+                QA: 'Qatar',
+                RO: 'Rumani',
+                RS: 'Serbia',
+                SA: 'Ả Rập Xê Út',
+                SE: 'Thuỵ Điển',
+                SI: 'Slovenia',
+                SK: 'Slovakia',
+                SM: 'San Marino',
+                SN: 'Senegal',
+                TN: 'Tunisia',
+                TR: 'Thổ Nhĩ Kỳ',
+                VG: 'Đảo Virgin, Anh quốc'
+            }
+        },
+        id: {
+            'default': 'Vui lòng nhập mã ID hợp lệ',
+            countryNotSupported: 'Mã quốc gia %s không được hỗ trợ',
+            country: 'Vui lòng nhập mã ID hợp lệ của %s',
+            countries: {
+                BA: 'Bosnia và Herzegovina',
+                BG: 'Bulgari',
+                BR: 'Brazil',
+                CH: 'Thuỵ Sĩ',
+                CL: 'Chi Lê',
+                CZ: 'Séc',
+                DK: 'Đan Mạch',
+                EE: 'Estonia',
+                ES: 'Tây Ban Nha',
+                FI: 'Phân Lan',
+                HR: 'Croatia',
+                IE: 'Ireland',
+                IS: 'Iceland',
+                LT: 'Lithuania',
+                LV: 'Latvia',
+                ME: 'Montenegro',
+                MK: 'Macedonia',
+                NL: 'Hà Lan',
+                RO: 'Rumani',
+                RS: 'Serbia',
+                SE: 'Thuỵ Điển',
+                SI: 'Slovenia',
+                SK: 'Slovakia',
+                SM: 'San Marino',
+                ZA: 'Nam Phi'
+            }
+        },
+        identical: {
+            'default': 'Vui lòng nhập cùng giá trị'
+        },
+        imei: {
+            'default': 'Vui lòng nhập số IMEI hợp lệ'
+        },
+        integer: {
+            'default': 'Vui lòng nhập số hợp lệ'
+        },
+        ip: {
+            'default': 'Vui lòng nhập địa chỉ IP hợp lệ'
+        },
+        isbn: {
+            'default': 'Vui lòng nhập số ISBN hợp lệ'
+        },
+        isin: {
+            'default': 'Vui lòng nhập số ISIN hợp lệ'
+        },
+        ismn: {
+            'default': 'Vui lòng nhập số ISMN hợp lệ'
+        },
+        issn: {
+            'default': 'Vui lòng nhập số ISSN hợp lệ'
+        },
+        lessThan: {
+            'default': 'Vui lòng nhập giá trị nhỏ hơn hoặc bằng %s',
+            notInclusive: 'Vui lòng nhập giá trị nhỏ hơn %s'
+        },
+        mac: {
+            'default': 'Vui lòng nhập địa chỉ MAC hợp lệ'
+        },
+        notEmpty: {
+            'default': 'Vui lòng nhập giá trị'
+        },
+        numeric: {
+            'default': 'Vui lòng nhập số hợp lệ'
+        },
+        phone: {
+            'default': 'Vui lòng nhập số điện thoại hợp lệ',
+            countryNotSupported: 'Mã quốc gia %s không được hỗ trợ',
+            country: 'Vui lòng nhập số điện thoại hợp lệ của %s',
+            countries: {
+                GB: 'Vương quốc Anh',
+                US: 'Mỹ'
+            }
+        },
+        regexp: {
+            'default': 'Vui lòng nhập giá trị thích hợp với biểu mẫu'
+        },
+        remote: {
+            'default': 'Vui lòng nhập giá trị hợp lệ'
+        },
+        rtn: {
+            'default': 'Vui lòng nhập số RTN hợp lệ'
+        },
+        sedol: {
+            'default': 'Vui lòng nhập số SEDOL hợp lệ'
+        },
+        siren: {
+            'default': 'Vui lòng nhập số Siren hợp lệ'
+        },
+        siret: {
+            'default': 'Vui lòng nhập số Siret hợp lệ'
+        },
+        step: {
+            'default': 'Vui lòng nhập bước nhảy của %s'
+        },
+        stringCase: {
+            'default': 'Vui lòng nhập ký tự thường',
+            upper: 'Vui lòng nhập ký tự in hoa'
+        },
+        stringLength: {
+            'default': 'Vui lòng nhập giá trị có độ dài hợp lệ',
+            less: 'Vui lòng nhập ít hơn %s ký tự',
+            more: 'Vui lòng nhập nhiều hơn %s ký tự',
+            between: 'Vui lòng nhập giá trị có độ dài trong khoảng %s và %s ký tự'
+        },
+        uri: {
+            'default': 'Vui lòng nhập địa chỉ URI hợp lệ'
+        },
+        uuid: {
+            'default': 'Vui lòng nhập số UUID hợp lệ',
+            version: 'Vui lòng nhập số UUID phiên bản %s hợp lệ'
+        },
+        vat: {
+            'default': 'Vui lòng nhập số VAT hợp lệ',
+            countryNotSupported: 'Mã quốc gia %s không được hỗ trợ',
+            country: 'Vui lòng nhập số VAT hợp lệ của %s',
+            countries: {
+                AT: 'Áo',
+                BE: 'Bỉ',
+                BG: 'Bulgari',
+                CH: 'Thuỵ Sĩ',
+                CY: 'Síp',
+                CZ: 'Séc',
+                DE: 'Đức',
+                DK: 'Đan Mạch',
+                EE: 'Estonia',
+                ES: 'Tây Ban Nha',
+                FI: 'Phần Lan',
+                FR: 'Pháp',
+                GB: 'Vương quốc Anh',
+                GR: 'Hy Lạp',
+                EL: 'Hy Lạp',
+                HU: 'Hungari',
+                HR: 'Croatia',
+                IE: 'Ireland',
+                IT: 'Ý',
+                LT: 'Lithuania',
+                LU: 'Luxembourg',
+                LV: 'Latvia',
+                MT: 'Maltese',
+                NL: 'Hà Lan',
+                NO: 'Na Uy',
+                PL: 'Ba Lan',
+                PT: 'Bồ Đào Nha',
+                RO: 'Rumani',
+                RU: 'Nga',
+                RS: 'Serbi',
+                SE: 'Thuỵ Điển',
+                SI: 'Slovenia',
+                SK: 'Slovakia'
+            }
+        },
+        vin: {
+            'default': 'Vui lòng nhập số VIN hợp lệ'
+        },
+        zipCode: {
+            'default': 'Vui lòng nhập mã bưu điện hợp lệ',
+            countryNotSupported: 'Mã quốc gia %s không được hỗ trợ',
+            country: 'Vui lòng nhập %s',
+            countries: {
+                'CA': 'mã bưu điện của Canada',
+                'DK': 'mã bưu điện của Đan Mạch',
+                'GB': 'mã bưu điện của Vương quốc Anh',
+                'IT': 'mã bưu điện của Ý',
+                'NL': 'mã bưu điện của Hà Lan',
+                'SE': 'mã bưu điện của Thuỵ Sĩ',
+                'SG': 'mã bưu điện của Singapore',
+                'US': 'mã bưu điện của Mỹ'
+            }
+        }
+    });
+}(window.jQuery));

+ 320 - 0
src/js/languages/vi_VN.js

@@ -0,0 +1,320 @@
+(function($) {
+    $.fn.bootstrapValidator.i18n = $.extend(true, $.fn.bootstrapValidator.i18n, {
+        base64: {
+            'default': 'Vui lòng nhập chuỗi mã hoá base64 hợp lệ'
+        },
+        between: {
+            'default': 'Vui lòng nhập giá trị nằm giữa %s và %s',
+            notInclusive: 'Vui lòng nhập giá trị nằm giữa %s và %s'
+        },
+        callback: {
+            'default': 'Vui lòng nhập giá trị hợp lệ'
+        },
+        choice: {
+            'default': 'Vui lòng nhập giá trị hợp lệ',
+            less: 'Vui lòng chọn ít nhất %s lựa chọn',
+            more: 'Vui lòng chọn nhiều nhất %s lựa chọn',
+            between: 'Vui lòng chọn %s - %s lựa chọn',
+        },
+        creditCard: {
+            'default': 'Vui lòng nhập số thẻ tín dụng hợp lệ'
+        },
+        cusip: {
+            'default': 'Vui lòng nhập số CUSIP hợp lệ'
+        },
+        cvv: {
+            'default': 'Vui lòng nhập số CVV hợp lệ'
+        },
+        date: {
+            'default': 'Vui lòng nhập ngày hợp lệ'
+        },
+        different: {
+            'default': 'Vui lòng nhập một giá trị khác'
+        },
+        digits: {
+             'default': 'Vui lòng chỉ nhập số'
+        },
+        ean: {
+            'default': 'Vui lòng nhập số EAN hợp lệ'
+        },
+        emailAddress: {
+            'default': 'Vui lòng nhập địa chỉ email hợp lệ'
+        },
+        file: {
+            'default': 'Vui lòng chọn file hợp lệ'
+        },
+        greaterThan: {
+            'default': 'Vui lòng nhập giá trị lớn hơn hoặc bằng %s',
+            notInclusive: 'Vui lòng nhập giá trị lớn hơn %s'
+        },
+        grid: {
+            'default': 'Vui lòng nhập số GRId hợp lệ'
+        },
+        hex: {
+            'default': 'Vui lòng nhập số hexa hợp lệ'
+        },
+        hexColor: {
+            'default': 'Vui lòng nhập mã màu hợp lệ'
+        },
+        iban: {
+            'default': 'Vui lòng nhập số IBAN hợp lệ',
+            countryNotSupported: 'Mã quốc gia %s không được hỗ trợ',
+            country: 'Vui lòng nhập mã IBAN hợp lệ của %s',
+            countries: {
+                AD: 'Andorra',
+                AE: 'Tiểu vương quốc Ả Rập thống nhất',
+                AL: 'Albania',
+                AO: 'Angola',
+                AT: 'Áo',
+                AZ: 'Azerbaijan',
+                BA: 'Bosnia và Herzegovina',
+                BE: 'Bỉ',
+                BF: 'Burkina Faso',
+                BG: 'Bulgaria',
+                BH: 'Bahrain',
+                BI: 'Burundi',
+                BJ: 'Benin',
+                BR: 'Brazil',
+                CH: 'Thuỵ Sĩ',
+                CI: 'Bờ Biển Ngà',
+                CM: 'Cameroon',
+                CR: 'Costa Rica',
+                CV: 'Cape Verde',
+                CY: 'Síp',
+                CZ: 'Séc',
+                DE: 'Đức',
+                DK: 'Đan Mạch',
+                DO: 'Dominican',
+                DZ: 'Algeria',
+                EE: 'Estonia',
+                ES: 'Tây Ban Nha',
+                FI: 'Phần Lan',
+                FO: 'đảo Faroe',
+                FR: 'Pháp',
+                GB: 'Vương quốc Anh',
+                GE: 'Georgia',
+                GI: 'Gibraltar',
+                GL: 'Greenland',
+                GR: 'Hy Lạp',
+                GT: 'Guatemala',
+                HR: 'Croatia',
+                HU: 'Hungary',
+                IE: 'Ireland',
+                IL: 'Israel',
+                IR: 'Iran',
+                IS: 'Iceland',
+                IT: 'Ý',
+                JO: 'Jordan',
+                KW: 'Kuwait',
+                KZ: 'Kazakhstan',
+                LB: 'Lebanon',
+                LI: 'Liechtenstein',
+                LT: 'Lithuania',
+                LU: 'Luxembourg',
+                LV: 'Latvia',
+                MC: 'Monaco',
+                MD: 'Moldova',
+                ME: 'Montenegro',
+                MG: 'Madagascar',
+                MK: 'Macedonia',
+                ML: 'Mali',
+                MR: 'Mauritania',
+                MT: 'Malta',
+                MU: 'Mauritius',
+                MZ: 'Mozambique',
+                NL: 'Hà Lan',
+                NO: 'Na Uy',
+                PK: 'Pakistan',
+                PL: 'Ba Lan',
+                PS: 'Palestinian',
+                PT: 'Bồ Đào Nha',
+                QA: 'Qatar',
+                RO: 'Rumani',
+                RS: 'Serbia',
+                SA: 'Ả Rập Xê Út',
+                SE: 'Thuỵ Điển',
+                SI: 'Slovenia',
+                SK: 'Slovakia',
+                SM: 'San Marino',
+                SN: 'Senegal',
+                TN: 'Tunisia',
+                TR: 'Thổ Nhĩ Kỳ',
+                VG: 'Đảo Virgin, Anh quốc'
+            }
+        },
+        id: {
+            'default': 'Vui lòng nhập mã ID hợp lệ',
+            countryNotSupported: 'Mã quốc gia %s không được hỗ trợ',
+            country: 'Vui lòng nhập mã ID hợp lệ của %s',
+            countries: {
+                BA: 'Bosnia và Herzegovina',
+                BG: 'Bulgari',
+                BR: 'Brazil',
+                CH: 'Thuỵ Sĩ',
+                CL: 'Chi Lê',
+                CZ: 'Séc',
+                DK: 'Đan Mạch',
+                EE: 'Estonia',
+                ES: 'Tây Ban Nha',
+                FI: 'Phân Lan',
+                HR: 'Croatia',
+                IE: 'Ireland',
+                IS: 'Iceland',
+                LT: 'Lithuania',
+                LV: 'Latvia',
+                ME: 'Montenegro',
+                MK: 'Macedonia',
+                NL: 'Hà Lan',
+                RO: 'Rumani',
+                RS: 'Serbia',
+                SE: 'Thuỵ Điển',
+                SI: 'Slovenia',
+                SK: 'Slovakia',
+                SM: 'San Marino',
+                ZA: 'Nam Phi'
+            }
+        },
+        identical: {
+            'default': 'Vui lòng nhập cùng giá trị'
+        },
+        imei: {
+            'default': 'Vui lòng nhập số IMEI hợp lệ'
+        },
+        integer: {
+            'default': 'Vui lòng nhập số hợp lệ'
+        },
+        ip: {
+            'default': 'Vui lòng nhập địa chỉ IP hợp lệ'
+        },
+        isbn: {
+            'default': 'Vui lòng nhập số ISBN hợp lệ'
+        },
+        isin: {
+            'default': 'Vui lòng nhập số ISIN hợp lệ'
+        },
+        ismn: {
+            'default': 'Vui lòng nhập số ISMN hợp lệ'
+        },
+        issn: {
+            'default': 'Vui lòng nhập số ISSN hợp lệ'
+        },
+        lessThan: {
+            'default': 'Vui lòng nhập giá trị nhỏ hơn hoặc bằng %s',
+            notInclusive: 'Vui lòng nhập giá trị nhỏ hơn %s'
+        },
+        mac: {
+            'default': 'Vui lòng nhập địa chỉ MAC hợp lệ'
+        },
+        notEmpty: {
+            'default': 'Vui lòng nhập giá trị'
+        },
+        numeric: {
+            'default': 'Vui lòng nhập số hợp lệ'
+        },
+        phone: {
+            'default': 'Vui lòng nhập số điện thoại hợp lệ',
+            countryNotSupported: 'Mã quốc gia %s không được hỗ trợ',
+            country: 'Vui lòng nhập số điện thoại hợp lệ của %s',
+            countries: {
+                GB: 'Vương quốc Anh',
+                US: 'Mỹ'
+            }
+        },
+        regexp: {
+            'default': 'Vui lòng nhập giá trị thích hợp với biểu mẫu'
+        },
+        remote: {
+            'default': 'Vui lòng nhập giá trị hợp lệ'
+        },
+        rtn: {
+            'default': 'Vui lòng nhập số RTN hợp lệ'
+        },
+        sedol: {
+            'default': 'Vui lòng nhập số SEDOL hợp lệ'
+        },
+        siren: {
+            'default': 'Vui lòng nhập số Siren hợp lệ'
+        },
+        siret: {
+            'default': 'Vui lòng nhập số Siret hợp lệ'
+        },
+        step: {
+            'default': 'Vui lòng nhập bước nhảy của %s'
+        },
+        stringCase: {
+            'default': 'Vui lòng nhập ký tự thường',
+            upper: 'Vui lòng nhập ký tự in hoa'
+        },
+        stringLength: {
+            'default': 'Vui lòng nhập giá trị có độ dài hợp lệ',
+            less: 'Vui lòng nhập ít hơn %s ký tự',
+            more: 'Vui lòng nhập nhiều hơn %s ký tự',
+            between: 'Vui lòng nhập giá trị có độ dài trong khoảng %s và %s ký tự'
+        },
+        uri: {
+            'default': 'Vui lòng nhập địa chỉ URI hợp lệ'
+        },
+        uuid: {
+            'default': 'Vui lòng nhập số UUID hợp lệ',
+            version: 'Vui lòng nhập số UUID phiên bản %s hợp lệ'
+        },
+        vat: {
+            'default': 'Vui lòng nhập số VAT hợp lệ',
+            countryNotSupported: 'Mã quốc gia %s không được hỗ trợ',
+            country: 'Vui lòng nhập số VAT hợp lệ của %s',
+            countries: {
+                AT: 'Áo',
+                BE: 'Bỉ',
+                BG: 'Bulgari',
+                CH: 'Thuỵ Sĩ',
+                CY: 'Síp',
+                CZ: 'Séc',
+                DE: 'Đức',
+                DK: 'Đan Mạch',
+                EE: 'Estonia',
+                ES: 'Tây Ban Nha',
+                FI: 'Phần Lan',
+                FR: 'Pháp',
+                GB: 'Vương quốc Anh',
+                GR: 'Hy Lạp',
+                EL: 'Hy Lạp',
+                HU: 'Hungari',
+                HR: 'Croatia',
+                IE: 'Ireland',
+                IT: 'Ý',
+                LT: 'Lithuania',
+                LU: 'Luxembourg',
+                LV: 'Latvia',
+                MT: 'Maltese',
+                NL: 'Hà Lan',
+                NO: 'Na Uy',
+                PL: 'Ba Lan',
+                PT: 'Bồ Đào Nha',
+                RO: 'Rumani',
+                RU: 'Nga',
+                RS: 'Serbi',
+                SE: 'Thuỵ Điển',
+                SI: 'Slovenia',
+                SK: 'Slovakia'
+            }
+        },
+        vin: {
+            'default': 'Vui lòng nhập số VIN hợp lệ'
+        },
+        zipCode: {
+            'default': 'Vui lòng nhập mã bưu điện hợp lệ',
+            countryNotSupported: 'Mã quốc gia %s không được hỗ trợ',
+            country: 'Vui lòng nhập %s',
+            countries: {
+                'CA': 'mã bưu điện của Canada',
+                'DK': 'mã bưu điện của Đan Mạch',
+                'GB': 'mã bưu điện của Vương quốc Anh',
+                'IT': 'mã bưu điện của Ý',
+                'NL': 'mã bưu điện của Hà Lan',
+                'SE': 'mã bưu điện của Thuỵ Sĩ',
+                'SG': 'mã bưu điện của Singapore',
+                'US': 'mã bưu điện của Mỹ'
+            }
+        }
+    });
+}(window.jQuery));