-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
143 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,134 @@ | ||
package valdo | ||
|
||
// Locales registry with all locales supported out-of-the-box. | ||
var DefaultLocales = Locales{ | ||
"nl": Dutch, | ||
"ru": Russian, | ||
"de": German, | ||
"fr": French, | ||
} | ||
|
||
// The original English error mesages, for reference. | ||
var English = Locale{ | ||
ErrNoInput{}: "the input is empty", | ||
ErrProperty{}: "{name}: {error}", | ||
ErrIndex{}: "at {index}: {error}", | ||
ErrType{}: "invalid type: got {got}, expected {expected}", | ||
ErrRequired{}: "{name} is required but not found", | ||
ErrUnexpected{}: "unexpected property: {name}", | ||
ErrMultipleOf{}: "must be a multiple of {value}", | ||
ErrNot{}: "must not match the schema", | ||
ErrMin{}: "must be greater than or equal to {value}", | ||
ErrExclMin{}: "must be greater than {value}", | ||
ErrMax{}: "must be less than or equal to {value}", | ||
ErrExclMax{}: "must be less than {value}", | ||
ErrMinLen{}: "must be at least {value} characters long", | ||
ErrMaxLen{}: "must be at most {value} characters long", | ||
ErrPattern{}: "must match the pattern", | ||
ErrContains{}: "at least one item {error}", | ||
ErrMinItems{}: "must contain at least {value} items", | ||
ErrMaxItems{}: "must contain at most {value} items", | ||
ErrPropertyNames{}: "property name {name} {error}", | ||
ErrMinProperties{}: "must contain at least {value} properties", | ||
ErrMaxProperties{}: "must contain at most {value} properties", | ||
} | ||
|
||
// Dutch translation of all error messages. | ||
var Dutch = Locale{ | ||
ErrNoInput{}: "de invoer is leeg", | ||
ErrProperty{}: "{name}: {error}", | ||
ErrIndex{}: "bij {index}: {error}", | ||
ErrType{}: "ongeldig type: kreeg {got}, verwachtte {expected}", | ||
ErrRequired{}: "{name} is vereist maar niet gevonden", | ||
ErrUnexpected{}: "onverwachte eigenschap: {name}", | ||
ErrMultipleOf{}: "moet een veelvoud van {value} zijn", | ||
ErrNot{}: "mag niet overeenkomen met het schema", | ||
ErrMin{}: "moet groter zijn dan of gelijk aan {value}", | ||
ErrExclMin{}: "moet groter zijn dan {value}", | ||
ErrMax{}: "moet kleiner zijn dan of gelijk aan {value}", | ||
ErrExclMax{}: "moet kleiner zijn dan {value}", | ||
ErrMinLen{}: "moet minstens {value} tekens lang zijn", | ||
ErrMaxLen{}: "mag maximaal {value} tekens lang zijn", | ||
ErrPattern{}: "moet overeenkomen met het patroon", | ||
ErrContains{}: "ten minste één item {error}", | ||
ErrMinItems{}: "moet minstens {value} items bevatten", | ||
ErrMaxItems{}: "mag maximaal {value} items bevatten", | ||
ErrPropertyNames{}: "eigenschapsnaam {name} {error}", | ||
ErrMinProperties{}: "moet minstens {value} eigenschappen bevatten", | ||
ErrMaxProperties{}: "mag maximaal {value} eigenschappen bevatten", | ||
} | ||
|
||
// Russian translation of all error messages. | ||
var Russian = Locale{ | ||
ErrNoInput{}: "ввод пуст", | ||
ErrProperty{}: "{name}: {error}", | ||
ErrIndex{}: "на {index}: {error}", | ||
ErrType{}: "неверный тип: получено {got}, ожидалось {expected}", | ||
ErrRequired{}: "{name} обязателен, но не найден", | ||
ErrUnexpected{}: "неожиданное свойство: {name}", | ||
ErrMultipleOf{}: "должно быть кратным {value}", | ||
ErrNot{}: "не должно соответствовать схеме", | ||
ErrMin{}: "должно быть больше или равно {value}", | ||
ErrExclMin{}: "должно быть больше {value}", | ||
ErrMax{}: "должно быть меньше или равно {value}", | ||
ErrExclMax{}: "должно быть меньше {value}", | ||
ErrMinLen{}: "должно содержать как минимум {value} символов", | ||
ErrMaxLen{}: "должно содержать не более {value} символов", | ||
ErrPattern{}: "должно соответствовать шаблону", | ||
ErrContains{}: "как минимум один элемент {error}", | ||
ErrMinItems{}: "должно содержать как минимум {value} элементов", | ||
ErrMaxItems{}: "должно содержать не более {value} элементов", | ||
ErrPropertyNames{}: "имя свойства {name} {error}", | ||
ErrMinProperties{}: "должно содержать как минимум {value} свойств", | ||
ErrMaxProperties{}: "должно содержать не более {value} свойств", | ||
} | ||
|
||
// German translation of all error messages. | ||
var German = Locale{ | ||
ErrNoInput{}: "Die Eingabe ist leer", | ||
ErrProperty{}: "{name}: {error}", | ||
ErrIndex{}: "bei {index}: {error}", | ||
ErrType{}: "Ungültiger Typ: erhalten {got}, erwartet {expected}", | ||
ErrRequired{}: "{name} ist erforderlich, wurde aber nicht gefunden", | ||
ErrUnexpected{}: "Unerwartete Eigenschaft: {name}", | ||
ErrMultipleOf{}: "Muss ein Vielfaches von {value} sein", | ||
ErrNot{}: "Darf nicht dem Schema entsprechen", | ||
ErrMin{}: "Muss größer oder gleich {value} sein", | ||
ErrExclMin{}: "Muss größer als {value} sein", | ||
ErrMax{}: "Muss kleiner oder gleich {value} sein", | ||
ErrExclMax{}: "Muss kleiner als {value} sein", | ||
ErrMinLen{}: "Muss mindestens {value} Zeichen lang sein", | ||
ErrMaxLen{}: "Darf höchstens {value} Zeichen lang sein", | ||
ErrPattern{}: "Muss dem Muster entsprechen", | ||
ErrContains{}: "Mindestens ein Element {error}", | ||
ErrMinItems{}: "Muss mindestens {value} Elemente enthalten", | ||
ErrMaxItems{}: "Darf höchstens {value} Elemente enthalten", | ||
ErrPropertyNames{}: "Eigenschaftsname {name} {error}", | ||
ErrMinProperties{}: "Muss mindestens {value} Eigenschaften enthalten", | ||
ErrMaxProperties{}: "Darf höchstens {value} Eigenschaften enthalten", | ||
} | ||
|
||
// French translation of all error messages. | ||
var French = Locale{ | ||
ErrNoInput{}: "l'entrée est vide", | ||
ErrProperty{}: "{name}: {error}", | ||
ErrIndex{}: "à {index}: {error}", | ||
ErrType{}: "type invalide : reçu {got}, attendu {expected}", | ||
ErrRequired{}: "{name} est requis mais non trouvé", | ||
ErrUnexpected{}: "propriété inattendue : {name}", | ||
ErrMultipleOf{}: "doit être un multiple de {value}", | ||
ErrNot{}: "ne doit pas correspondre au schéma", | ||
ErrMin{}: "doit être supérieur ou égal à {value}", | ||
ErrExclMin{}: "doit être supérieur à {value}", | ||
ErrMax{}: "doit être inférieur ou égal à {value}", | ||
ErrExclMax{}: "doit être inférieur à {value}", | ||
ErrMinLen{}: "doit contenir au moins {value} caractères", | ||
ErrMaxLen{}: "doit contenir au maximum {value} caractères", | ||
ErrPattern{}: "doit correspondre au modèle", | ||
ErrContains{}: "au moins un élément {error}", | ||
ErrMinItems{}: "doit contenir au moins {value} éléments", | ||
ErrMaxItems{}: "doit contenir au maximum {value} éléments", | ||
ErrPropertyNames{}: "nom de la propriété {name} {error}", | ||
ErrMinProperties{}: "doit contenir au moins {value} propriétés", | ||
ErrMaxProperties{}: "doit contenir au maximum {value} propriétés", | ||
} |
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