Skip to content

Commit

Permalink
add Slovak - Slovak Republic (sk-SK) localization
Browse files Browse the repository at this point in the history
Closes #605
  • Loading branch information
harrison314 authored and crissdev committed Oct 9, 2019
1 parent 2373271 commit cad042c
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 45 deletions.
39 changes: 39 additions & 0 deletions localization/sk-SK.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Localization file for Slovak - Slovak Republic (sk-SK)
*/
(function (factory) {
// Module systems magic dance.
/*global require,ko.validation,define,module*/
if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {
// CommonJS or Node
module.exports = factory(require('../'));
} else if (typeof define === 'function' && define['amd']) {
// AMD anonymous module with hard-coded dependency on 'knockout.validation'
define(['knockout.validation'], factory);
} else {
// <script> tag: use the global `ko.validation` object
factory(ko.validation);
}
}(function (kv) {
if (!kv || typeof kv.defineLocale !== 'function') {
throw new Error('Knockout-Validation is required, please ensure it is loaded before this localization file');
}
return kv.defineLocale('sk-SK', {
required: 'Toto pole je povinné.',
min: 'Zadajte číslo väčšie alebo rovné {0}.',
max: 'Zadajte číslo menšie alebo rovné {0}.',
minLength: 'Vložte minimálne {0} znakov.',
maxLength: 'Vložte najviac {0} znakov.',
pattern: 'Skontrolujte formát poľa.',
step: 'Hodnota musí byť násobok {0}.',
email: 'Neplatná e-mailová adresa.',
date: 'Zadajte platný dátum.',
dateISO: 'Zadajte platný dátum.',
number: 'Zadajte číslo.',
digit: 'Zadajte číslice.',
phoneUS: 'Zadajte platné telefónne číslo.',
equal: 'Hodnoty musia byť rovnaké.',
notEqual: 'Vyberte inú hodnotu.',
unique: 'Skontrolujte, či je zadaná hodnota jedinečná.'
});
}));
1 change: 1 addition & 0 deletions test/locale-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ QUnit.test('Localization files can be loaded and applied', function(assert) {
assert.equal(ko.validation.locale('pt-PT'), 'pt-pt', 'Portuguese - Portugal (pt-PT)');
assert.equal(ko.validation.locale('ro-RO'), 'ro-ro', 'Romanian - Romania (ro-RO)');
assert.equal(ko.validation.locale('ru-RU'), 'ru-ru', 'Russian - Russia (ru-RU)');
assert.equal(ko.validation.locale('sk-SK'), 'sk-sk', 'Slovak - Slovak Republic (sk-SK)');
assert.equal(ko.validation.locale('sv-SE'), 'sv-se', 'Swedish - Sweden (sv-SE)');
assert.equal(ko.validation.locale('tr-TR'), 'tr-tr', 'Turkish - Turkey (tr-TR)');
assert.equal(ko.validation.locale('zh-CN'), 'zh-cn', 'Chinese - China (zh-CN)');
Expand Down
87 changes: 44 additions & 43 deletions test/test-runner-2.3.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,52 @@
<html>
<head>
<link href="lib/qunit-2.9.2.css" rel="stylesheet" type="text/css" />
<script src="lib/qunit-2.9.2.js" type="text/javascript"></script>
<script src="lib/qunit-2.9.2.js"></script>
<!--We only include jQuery for testing purposes (testing UI changes)-->
<script src="lib/jquery-2.1.3.js" type="text/javascript"></script>
<script src="lib/knockout-2.3.0.js" type="text/javascript"></script>
<script src="../dist/knockout.validation.js" type="text/javascript"></script>
<script src="lib/jquery-2.1.3.js"></script>
<script src="lib/knockout-2.3.0.js"></script>
<script src="../dist/knockout.validation.js"></script>

<script src="../localization/ar-JO.js" type="text/javascript"></script>
<script src="../localization/bg-BG.js" type="text/javascript"></script>
<script src="../localization/ca-ES.js" type="text/javascript"></script>
<script src="../localization/cs-CZ.js" type="text/javascript"></script>
<script src="../localization/da-DK.js" type="text/javascript"></script>
<script src="../localization/de-DE.js" type="text/javascript"></script>
<script src="../localization/el-GR.js" type="text/javascript"></script>
<script src="../localization/en-US.js" type="text/javascript"></script>
<script src="../localization/es-ES.js" type="text/javascript"></script>
<script src="../localization/fa-IR.js" type="text/javascript"></script>
<script src="../localization/fr-FR.js" type="text/javascript"></script>
<script src="../localization/he-IL.js" type="text/javascript"></script>
<script src="../localization/hr-HR.js" type="text/javascript"></script>
<script src="../localization/hu-HU.js" type="text/javascript"></script>
<script src="../localization/it-IT.js" type="text/javascript"></script>
<script src="../localization/ja-JP.js" type="text/javascript"></script>
<script src="../localization/ko-KR.js" type="text/javascript"></script>
<script src="../localization/lv-LV.js" type="text/javascript"></script>
<script src="../localization/nb-NO.js" type="text/javascript"></script>
<script src="../localization/nl-BE.js" type="text/javascript"></script>
<script src="../localization/nl-NL.js" type="text/javascript"></script>
<script src="../localization/pl-PL.js" type="text/javascript"></script>
<script src="../localization/pt-BR.js" type="text/javascript"></script>
<script src="../localization/pt-PT.js" type="text/javascript"></script>
<script src="../localization/ro-RO.js" type="text/javascript"></script>
<script src="../localization/ru-RU.js" type="text/javascript"></script>
<script src="../localization/sv-SE.js" type="text/javascript"></script>
<script src="../localization/tr-TR.js" type="text/javascript"></script>
<script src="../localization/zh-CN.js" type="text/javascript"></script>
<script src="../localization/zh-TW.js" type="text/javascript"></script>
<script src="../localization/ar-JO.js"></script>
<script src="../localization/bg-BG.js"></script>
<script src="../localization/ca-ES.js"></script>
<script src="../localization/cs-CZ.js"></script>
<script src="../localization/da-DK.js"></script>
<script src="../localization/de-DE.js"></script>
<script src="../localization/el-GR.js"></script>
<script src="../localization/en-US.js"></script>
<script src="../localization/es-ES.js"></script>
<script src="../localization/fa-IR.js"></script>
<script src="../localization/fr-FR.js"></script>
<script src="../localization/he-IL.js"></script>
<script src="../localization/hr-HR.js"></script>
<script src="../localization/hu-HU.js"></script>
<script src="../localization/it-IT.js"></script>
<script src="../localization/ja-JP.js"></script>
<script src="../localization/ko-KR.js"></script>
<script src="../localization/lv-LV.js"></script>
<script src="../localization/nb-NO.js"></script>
<script src="../localization/nl-BE.js"></script>
<script src="../localization/nl-NL.js"></script>
<script src="../localization/pl-PL.js"></script>
<script src="../localization/pt-BR.js"></script>
<script src="../localization/pt-PT.js"></script>
<script src="../localization/ro-RO.js"></script>
<script src="../localization/ru-RU.js"></script>
<script src="../localization/sk-SK.js"></script>
<script src="../localization/sv-SE.js"></script>
<script src="../localization/tr-TR.js"></script>
<script src="../localization/zh-CN.js"></script>
<script src="../localization/zh-TW.js"></script>

<!--test Scripts here-->
<script src="asserts.js" type="text/javascript"></script>
<script src="validation-tests.js" type="text/javascript"></script>
<script src="validation-ui-tests.js" type="text/javascript"></script>
<script src="utils-tests.js" type="text/javascript"></script>
<script src="api-tests.js" type="text/javascript"></script>
<script src="rules-tests.js" type="text/javascript"></script>
<script src="locale-tests.js" type="text/javascript"></script>
<script src="asserts.js"></script>
<script src="validation-tests.js"></script>
<script src="validation-ui-tests.js"></script>
<script src="utils-tests.js"></script>
<script src="api-tests.js"></script>
<script src="rules-tests.js"></script>
<script src="locale-tests.js"></script>

<title>Knockout JS Validation Tests (KnockoutJS v2.3.0)</title>
<style type="text/css">
Expand All @@ -59,7 +60,7 @@
<div id="qunit"></div>
<div id="testContainer"></div>
<div id="workbench">
<script type="text/javascript">
<script>
var captcha = function (val) {
return val == 11;
};
Expand Down Expand Up @@ -127,7 +128,7 @@
<br />
<br />
<button type="button" data-bind='click: requireLocation'>Make 'Location' required</button>
<script type="text/javascript">
<script>
$(function() {
ko.applyBindings(viewModel, $('#workbench')[0]);

Expand Down
3 changes: 2 additions & 1 deletion test/test-runner-3.4.2.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<link href="lib/qunit-2.9.2.css" rel="stylesheet" type="text/css" />
<script src="lib/qunit-2.9.2.js" type="text/javascript"></script>
<script src="lib/qunit-2.9.2.js"></script>
<!--We only include jQuery for testing purposes (testing UI changes)-->
<script src="lib/jquery-2.1.3.js"></script>
<script src="lib/knockout-3.4.2.js"></script>
Expand Down Expand Up @@ -34,6 +34,7 @@
<script src="../localization/pt-PT.js"></script>
<script src="../localization/ro-RO.js"></script>
<script src="../localization/ru-RU.js"></script>
<script src="../localization/sk-SK.js"></script>
<script src="../localization/sv-SE.js"></script>
<script src="../localization/tr-TR.js"></script>
<script src="../localization/zh-CN.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion test/test-runner-3.5.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<link href="lib/qunit-2.9.2.css" rel="stylesheet" type="text/css" />
<script src="lib/qunit-2.9.2.js" type="text/javascript"></script>
<script src="lib/qunit-2.9.2.js"></script>
<!--We only include jQuery for testing purposes (testing UI changes)-->
<script src="lib/jquery-2.1.3.js"></script>
<script src="lib/knockout-3.5.0.js"></script>
Expand Down Expand Up @@ -34,6 +34,7 @@
<script src="../localization/pt-PT.js"></script>
<script src="../localization/ro-RO.js"></script>
<script src="../localization/ru-RU.js"></script>
<script src="../localization/sk-SK.js"></script>
<script src="../localization/sv-SE.js"></script>
<script src="../localization/tr-TR.js"></script>
<script src="../localization/zh-CN.js"></script>
Expand Down

0 comments on commit cad042c

Please sign in to comment.