-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #503 from Knockout-Contrib/issue-492
Make localization files AMD and CommonJS/Node compatible
- Loading branch information
Showing
33 changed files
with
1,346 additions
and
815 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,58 @@ | ||
/// <reference path="../Src/knockout.validation.js" /> | ||
|
||
/************************************************ | ||
* This is an example localization page. All of these | ||
* messages are the default messages for ko.validation | ||
* | ||
* Currently ko.validation only does a single parameter replacement | ||
* on your message (indicated by the {0}). | ||
* | ||
* The parameter that you provide in your validation extender | ||
* is what is passed to your message to do the {0} replacement. | ||
* Currently ko.validation does multiple parameter replacement | ||
* on your message (indicated by the {0}, {1}, etc.). | ||
* | ||
* The parameters that you provide in your validation extender | ||
* are what are passed to your message to do the {0}, {1} etc. replacements. | ||
* | ||
* eg: myProperty.extend({ minLength: 5 }); | ||
* ... will provide a message of "Please enter at least 5 characters" | ||
* when validated | ||
* | ||
* eg: myProperty.extend({ between: [1, 5] }); | ||
* ... will provide a message of "Please enter between 1 and 5 characters" | ||
* when validated | ||
* | ||
* This message replacement obviously only works with primitives | ||
* such as numbers and strings. We do not stringify complex objects | ||
* such as numbers and strings. We do not stringify complex objects | ||
* or anything like that currently. | ||
*/ | ||
|
||
ko.validation.localize({ | ||
required: 'Моля, въведете стойност.', | ||
min: 'Моля, въведете стойност по-голяма или равна на {0}.', | ||
max: 'Моля, въведете стойност по-малка или равна на {0}.', | ||
minLength: 'Моля, въведете поне {0} символа.', | ||
maxLength: 'Моля, въведете по-малко от {0} символа.', | ||
pattern: 'Моля, проверете тази стойност.', | ||
step: 'Стойността трябва да се увеличава с {0}.', | ||
email: 'Това не е валиден e-mail адрес.', | ||
date: 'Моля, въведете валидна дата.', | ||
dateISO: 'Моля, въведете валидна дата.', | ||
number: 'Моля, въведете число.', | ||
digit: 'Моля, въведете цифра.', | ||
phoneUS: 'Моля, въведете валиден телефонен номер.', | ||
equal: 'Стойностите трябва да са равни.', | ||
notEqual: 'Моля, изберете различна стойност.', | ||
unique: 'Моля, убедете се, че стойността е уникална.' | ||
}); | ||
(function(factory) { | ||
// Module systems magic dance. | ||
/*global require,ko,define*/ | ||
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { | ||
// CommonJS or Node: hard-coded dependency on "knockout" | ||
factory(require("knockout")); | ||
} else if (typeof define === "function" && define["amd"]) { | ||
// AMD anonymous module with hard-coded dependency on "knockout" | ||
define(["knockout"], factory); | ||
} else { | ||
// <script> tag: use the global `ko` object, attaching a `mapping` property | ||
factory(ko); | ||
} | ||
}(function(ko) { | ||
if (!ko.validation && typeof ko.validation.localize !== 'function') { | ||
throw new Error('Knockout-Validation is required, please ensure it is loaded before this localization file'); | ||
} | ||
ko.validation.localize({ | ||
required: 'Моля, въведете стойност.', | ||
min: 'Моля, въведете стойност по-голяма или равна на {0}.', | ||
max: 'Моля, въведете стойност по-малка или равна на {0}.', | ||
minLength: 'Моля, въведете поне {0} символа.', | ||
maxLength: 'Моля, въведете по-малко от {0} символа.', | ||
pattern: 'Моля, проверете тази стойност.', | ||
step: 'Стойността трябва да се увеличава с {0}.', | ||
email: 'Това не е валиден e-mail адрес.', | ||
date: 'Моля, въведете валидна дата.', | ||
dateISO: 'Моля, въведете валидна дата.', | ||
number: 'Моля, въведете число.', | ||
digit: 'Моля, въведете цифра.', | ||
phoneUS: 'Моля, въведете валиден телефонен номер.', | ||
equal: 'Стойностите трябва да са равни.', | ||
notEqual: 'Моля, изберете различна стойност.', | ||
unique: 'Моля, убедете се, че стойността е уникална.' | ||
}); | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,58 @@ | ||
/// <reference path="../Src/knockout.validation.js" /> | ||
|
||
/************************************************ | ||
* This is an example localization page. All of these | ||
* messages are the default messages for ko.validation | ||
* | ||
* Currently ko.validation only does a single parameter replacement | ||
* on your message (indicated by the {0}). | ||
* | ||
* The parameter that you provide in your validation extender | ||
* is what is passed to your message to do the {0} replacement. | ||
* Currently ko.validation does multiple parameter replacement | ||
* on your message (indicated by the {0}, {1}, etc.). | ||
* | ||
* The parameters that you provide in your validation extender | ||
* are what are passed to your message to do the {0}, {1} etc. replacements. | ||
* | ||
* eg: myProperty.extend({ minLength: 5 }); | ||
* ... will provide a message of "Please enter at least 5 characters" | ||
* when validated | ||
* | ||
* eg: myProperty.extend({ between: [1, 5] }); | ||
* ... will provide a message of "Please enter between 1 and 5 characters" | ||
* when validated | ||
* | ||
* This message replacement obviously only works with primitives | ||
* such as numbers and strings. We do not stringify complex objects | ||
* such as numbers and strings. We do not stringify complex objects | ||
* or anything like that currently. | ||
*/ | ||
|
||
ko.validation.localize({ | ||
required: 'Aquest camp es obligatori', | ||
min: 'Introduir un valor igual o major que {0}', | ||
max: 'Introduir un valor menor o igual que {0}', | ||
minLength: 'Ha de tenir un mínim de {0} caràcters', | ||
maxLength: 'No pot tenir mes de {0} caràcters', | ||
pattern: 'Si us plau, comproveu aquest campo', | ||
step: "El valor ha d'incrementar-se en {0}", | ||
email: 'Aquesta no es una adreça de correu electrònic correcta', | ||
date: 'Introduir una data correcta', | ||
dateISO: 'Introduir una data correcta', | ||
number: 'Ha de ser un nombre', | ||
digit: 'Introduir un dígit', | ||
phoneUS: 'Ha de ser un número de telèfon vàlid', | ||
equal: 'Els valors han de ser iguals', | ||
notEqual: 'Elegiu un altre valor', | ||
unique: 'Ha de ser un valor únic' | ||
}); | ||
(function(factory) { | ||
// Module systems magic dance. | ||
/*global require,ko,define*/ | ||
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { | ||
// CommonJS or Node: hard-coded dependency on "knockout" | ||
factory(require("knockout")); | ||
} else if (typeof define === "function" && define["amd"]) { | ||
// AMD anonymous module with hard-coded dependency on "knockout" | ||
define(["knockout"], factory); | ||
} else { | ||
// <script> tag: use the global `ko` object, attaching a `mapping` property | ||
factory(ko); | ||
} | ||
}(function(ko) { | ||
if (!ko.validation && typeof ko.validation.localize !== 'function') { | ||
throw new Error('Knockout-Validation is required, please ensure it is loaded before this localization file'); | ||
} | ||
ko.validation.localize({ | ||
required: 'Aquest camp es obligatori', | ||
min: 'Introduir un valor igual o major que {0}', | ||
max: 'Introduir un valor menor o igual que {0}', | ||
minLength: 'Ha de tenir un mínim de {0} caràcters', | ||
maxLength: 'No pot tenir mes de {0} caràcters', | ||
pattern: 'Si us plau, comproveu aquest campo', | ||
step: "El valor ha d'incrementar-se en {0}", | ||
email: 'Aquesta no es una adreça de correu electrònic correcta', | ||
date: 'Introduir una data correcta', | ||
dateISO: 'Introduir una data correcta', | ||
number: 'Ha de ser un nombre', | ||
digit: 'Introduir un dígit', | ||
phoneUS: 'Ha de ser un número de telèfon vàlid', | ||
equal: 'Els valors han de ser iguals', | ||
notEqual: 'Elegiu un altre valor', | ||
unique: 'Ha de ser un valor únic' | ||
}); | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,58 @@ | ||
/// <reference path="../Src/knockout.validation.js" /> | ||
|
||
/************************************************ | ||
* This is an example localization page. All of these | ||
* messages are the default messages for ko.validation | ||
* | ||
* Currently ko.validation only does a single parameter replacement | ||
* on your message (indicated by the {0}). | ||
* | ||
* The parameter that you provide in your validation extender | ||
* is what is passed to your message to do the {0} replacement. | ||
* Currently ko.validation does multiple parameter replacement | ||
* on your message (indicated by the {0}, {1}, etc.). | ||
* | ||
* The parameters that you provide in your validation extender | ||
* are what are passed to your message to do the {0}, {1} etc. replacements. | ||
* | ||
* eg: myProperty.extend({ minLength: 5 }); | ||
* ... will provide a message of "Please enter at least 5 characters" | ||
* when validated | ||
* | ||
* eg: myProperty.extend({ between: [1, 5] }); | ||
* ... will provide a message of "Please enter between 1 and 5 characters" | ||
* when validated | ||
* | ||
* This message replacement obviously only works with primitives | ||
* such as numbers and strings. We do not stringify complex objects | ||
* such as numbers and strings. We do not stringify complex objects | ||
* or anything like that currently. | ||
*/ | ||
|
||
ko.validation.localize({ | ||
required: 'Toto pole je povinné.', | ||
min: 'Zadejte číslo větší nebo rovné {0}.', | ||
max: 'Zadejte číslo menší nebo rovné {0}.', | ||
minLength: 'Vložte alespoň {0} znaků.', | ||
maxLength: 'Vložte nejvíce {0} znaků.', | ||
pattern: 'Zkontrolujte formát pole.', | ||
step: 'Hodnota musí být násobek {0}.', | ||
email: 'Neplatná e-mailová adresa.', | ||
date: 'Zadejte platné datum.', | ||
dateISO: 'Zadejte platné datum.', | ||
number: 'Zadejte číslo.', | ||
digit: 'Zadejte číslice.', | ||
phoneUS: 'Zadejte platné telefonní číslo.', | ||
equal: 'Hodnoty musí být stejné.', | ||
notEqual: 'Vyberte jinou hodnotu.', | ||
unique: 'Zkontrolujte, zda hodnota je jedinečná.' | ||
}); | ||
(function(factory) { | ||
// Module systems magic dance. | ||
/*global require,ko,define*/ | ||
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { | ||
// CommonJS or Node: hard-coded dependency on "knockout" | ||
factory(require("knockout")); | ||
} else if (typeof define === "function" && define["amd"]) { | ||
// AMD anonymous module with hard-coded dependency on "knockout" | ||
define(["knockout"], factory); | ||
} else { | ||
// <script> tag: use the global `ko` object, attaching a `mapping` property | ||
factory(ko); | ||
} | ||
}(function(ko) { | ||
if (!ko.validation && typeof ko.validation.localize !== 'function') { | ||
throw new Error('Knockout-Validation is required, please ensure it is loaded before this localization file'); | ||
} | ||
ko.validation.localize({ | ||
required: 'Toto pole je povinné.', | ||
min: 'Zadejte číslo větší nebo rovné {0}.', | ||
max: 'Zadejte číslo menší nebo rovné {0}.', | ||
minLength: 'Vložte alespoň {0} znaků.', | ||
maxLength: 'Vložte nejvíce {0} znaků.', | ||
pattern: 'Zkontrolujte formát pole.', | ||
step: 'Hodnota musí být násobek {0}.', | ||
email: 'Neplatná e-mailová adresa.', | ||
date: 'Zadejte platné datum.', | ||
dateISO: 'Zadejte platné datum.', | ||
number: 'Zadejte číslo.', | ||
digit: 'Zadejte číslice.', | ||
phoneUS: 'Zadejte platné telefonní číslo.', | ||
equal: 'Hodnoty musí být stejné.', | ||
notEqual: 'Vyberte jinou hodnotu.', | ||
unique: 'Zkontrolujte, zda hodnota je jedinečná.' | ||
}); | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,58 @@ | ||
/// <reference path="../Src/knockout.validation.js" /> | ||
|
||
/************************************************ | ||
* This is an example localization page. All of these | ||
* messages are the default messages for ko.validation | ||
* | ||
* Currently ko.validation only does a single parameter replacement | ||
* on your message (indicated by the {0}). | ||
* | ||
* The parameter that you provide in your validation extender | ||
* is what is passed to your message to do the {0} replacement. | ||
* Currently ko.validation does multiple parameter replacement | ||
* on your message (indicated by the {0}, {1}, etc.). | ||
* | ||
* The parameters that you provide in your validation extender | ||
* are what are passed to your message to do the {0}, {1} etc. replacements. | ||
* | ||
* eg: myProperty.extend({ minLength: 5 }); | ||
* ... will provide a message of "Please enter at least 5 characters" | ||
* when validated | ||
* | ||
* eg: myProperty.extend({ between: [1, 5] }); | ||
* ... will provide a message of "Please enter between 1 and 5 characters" | ||
* when validated | ||
* | ||
* This message replacement obviously only works with primitives | ||
* such as numbers and strings. We do not stringify complex objects | ||
* such as numbers and strings. We do not stringify complex objects | ||
* or anything like that currently. | ||
*/ | ||
|
||
ko.validation.localize({ | ||
required: 'Dette felt er påkrævet.', | ||
min: 'Angiv en værdi der mindst er {0}.', | ||
max: 'Angiv en værdi der højst er {0}.', | ||
minLength: 'Indtast mindst {0} tegn.', | ||
maxLength: 'Indtast højst {0} tegn.', | ||
pattern: 'Tjek venligst denne værdi.', | ||
step: 'Værdien skal stige med {0}', | ||
email: 'Dette er ikke en gyldig e-mail-adresse', | ||
date: 'Indtast en gyldig dato', | ||
dateISO: 'Indtast en gyldig dato', | ||
number: 'Indtast et tal', | ||
digit: 'Indtast et ciffer', | ||
phoneUS: 'Indtast et gyldigt telefonnummer', | ||
equal: 'Indtast den samme værdi igen.', | ||
notEqual: 'Indtast en anden værdi.', | ||
unique: 'Sørg for at værdien er unik.' | ||
}); | ||
(function(factory) { | ||
// Module systems magic dance. | ||
/*global require,ko,define*/ | ||
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { | ||
// CommonJS or Node: hard-coded dependency on "knockout" | ||
factory(require("knockout")); | ||
} else if (typeof define === "function" && define["amd"]) { | ||
// AMD anonymous module with hard-coded dependency on "knockout" | ||
define(["knockout"], factory); | ||
} else { | ||
// <script> tag: use the global `ko` object, attaching a `mapping` property | ||
factory(ko); | ||
} | ||
}(function(ko) { | ||
if (!ko.validation && typeof ko.validation.localize !== 'function') { | ||
throw new Error('Knockout-Validation is required, please ensure it is loaded before this localization file'); | ||
} | ||
ko.validation.localize({ | ||
required: 'Dette felt er påkrævet.', | ||
min: 'Angiv en værdi der mindst er {0}.', | ||
max: 'Angiv en værdi der højst er {0}.', | ||
minLength: 'Indtast mindst {0} tegn.', | ||
maxLength: 'Indtast højst {0} tegn.', | ||
pattern: 'Tjek venligst denne værdi.', | ||
step: 'Værdien skal stige med {0}', | ||
email: 'Dette er ikke en gyldig e-mail-adresse', | ||
date: 'Indtast en gyldig dato', | ||
dateISO: 'Indtast en gyldig dato', | ||
number: 'Indtast et tal', | ||
digit: 'Indtast et ciffer', | ||
phoneUS: 'Indtast et gyldigt telefonnummer', | ||
equal: 'Indtast den samme værdi igen.', | ||
notEqual: 'Indtast en anden værdi.', | ||
unique: 'Sørg for at værdien er unik.' | ||
}); | ||
})); |
Oops, something went wrong.