-
Notifications
You must be signed in to change notification settings - Fork 329
i18 support for spanish and english locales are added #1021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 7 commits
c36d6aa
999ff49
b94056b
bb7009d
42d30e5
e6c2c08
80e9213
e37cd92
49e426b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
$ref = {0}: tiene un error con ''refs'' | ||
additionalItems = {0}: el índice ''{1}'' no está definido en el esquema y el esquema no permite elementos adicionales | ||
additionalProperties = {0}: la propiedad ''{1}'' no está definida en el esquema y el esquema no permite propiedades adicionales | ||
allOf = {0}: debe ser válido para todos los esquemas {1} | ||
anyOf = {0}: debe ser válido para cualquiera de los esquemas {1} | ||
const = {0}: debe ser el valor constante ''{1}'' | ||
contains = {0}: no contiene un elemento que pase estas validaciones: {2} | ||
contains.max = {0}: debe contener como máximo {1} elemento(s) que pasen estas validaciones: {2} | ||
contains.min = {0}: debe contener al menos {1} elemento(s) que pasen estas validaciones: {2} | ||
dependencies = {0}: tiene un error con las dependencias {1} | ||
dependentRequired = {0}: le falta una propiedad ''{1}'' que es dependiente requerida porque ''{2}'' está presente | ||
dependentSchemas = {0}: tiene un error con dependienteSchemas {1} | ||
enum={0}: no tiene valor en la enumeración {1} | ||
exclusiveMaximum = {0}: debe tener un valor máximo exclusivo de {1} | ||
exclusiveMinimum = {0}: debe tener un valor mínimo exclusivo de {1} | ||
false = {0}: el esquema para ''{1}'' es falso | ||
format = {0}: no coincide con el patrón {1} {2} | ||
format.date = {0}: no coincide con el patrón {1} debe ser una fecha completa RFC 3339 válida | ||
format.date-time = {0}: no coincide con el patrón {1} debe ser una fecha y hora RFC 3339 válida | ||
format.duration = {0}: no coincide con el patrón {1} debe tener una duración ISO 8601 válida | ||
format.email = {0}: no coincide con el patrón {1} debe ser un buzón RFC 5321 válido | ||
format.ipv4 = {0}: no coincide con el patrón {1} debe ser una dirección IP RFC 2673 válida | ||
format.ipv6 = {0}: no coincide con el patrón {1} debe ser una dirección IP RFC 4291 válida | ||
format.idn-email = {0}: no coincide con el patrón {1} debe ser un buzón RFC 6531 válido | ||
format.idn-hostname = {0}: no coincide con el patrón {1} debe ser un nombre de host internacionalizado RFC 5890 válido | ||
format.iri = {0}: no coincide con el patrón {1} debe ser un IRI RFC 3987 válido | ||
format.iri-reference = {0}: no coincide con el patrón {1} debe ser una referencia IRI RFC 3987 válida | ||
format.uri = {0}: no coincide con el patrón {1} debe ser un URI RFC 3986 válido | ||
format.uri-reference = {0}: no coincide con el patrón {1} debe ser una referencia URI RFC 3986 válida | ||
format.uri-template = {0}: no coincide con el patrón {1} debe ser una plantilla URI RFC 6570 válida | ||
format.uuid = {0}: no coincide con el patrón {1} debe ser un UUID RFC 4122 válido | ||
format.regex = {0}: no coincide con el patrón {1} debe ser una expresión regular ECMA-262 válida | ||
format.time = {0}: no coincide con el patrón {1} debe ser una hora RFC 3339 válida | ||
format.hostname = {0}: no coincide con el patrón {1} debe ser un nombre de host RFC 1123 válido | ||
format.json-pointer = {0}: no coincide con el patrón {1} debe ser un puntero JSON RFC 6901 válido | ||
format.relative-json-pointer = {0}: no coincide con el patrón {1} debe ser un puntero JSON relativo de IETF válido | ||
format.unknown = {0}: tiene un formato desconocido ''{1}'' | ||
id = {0}: ''{1}'' no es un {2} válido | ||
items = {0}: el índice ''{1}'' no está definido en el esquema y el esquema no permite elementos adicionales | ||
maxContains = {0}: debe ser un número entero no negativo en {1} | ||
maxItems = {0}: debe tener como máximo {1} elementos pero encontró {2} | ||
maxLength = {0}: debe tener como máximo {1} caracteres | ||
maxProperties = {0}: debe tener como máximo {1} propiedades | ||
maximum = {0}: debe tener un valor máximo de {1} | ||
minContains = {0}: debe ser un número entero no negativo en {1} | ||
minContainsVsMaxContains = {0}: minContains debe ser menor o igual que maxContains en {1} | ||
minItems = {0}: debe tener al menos {1} elementos pero se encontró {2} | ||
minLength = {0}: debe tener al menos {1} caracteres | ||
minProperties = {0}: debe tener al menos {1} propiedades | ||
minimum = {0}: debe tener un valor mínimo de {1} | ||
multipleOf = {0}: debe ser múltiplo de {1} | ||
not = {0}: no debe ser válido para el esquema {1} | ||
notAllowed = {0}: la propiedad ''{1}'' no está permitida pero está en los datos | ||
oneOf = {0}: debe ser válido para uno y solo un esquema, pero {1} son válidos | ||
oneOf.indexes = {0}: debe ser válido para uno y solo un esquema, pero {1} son válidos con índices ''{2}'' | ||
pattern = {0}: no coincide con el patrón de expresión regular {1} | ||
patternProperties = {0}: tiene algún error con ''propiedades de patrón'' | ||
prefixItems = {0}: no se encontró ningún validador en este índice | ||
properties = {0}: tiene un error con ''propiedades'' | ||
propertyNames = {0}: el nombre de la propiedad ''{1}'' no es válido: {2} | ||
readOnly = {0}: es un campo de solo lectura, no se puede cambiar | ||
required = {0}: propiedad requerida ''{1}'' no encontrada | ||
type = {0}: {1} encontrado, {2} esperado | ||
unevaluatedItems = {0}: el índice ''{1}'' no se evalúa y el esquema no permite elementos no evaluados | ||
unevaluatedProperties = {0}: la propiedad ''{1}'' no se evalúa y el esquema no permite propiedades no evaluadas | ||
unionType = {0}: {1} encontrado, {2} esperado | ||
uniqueItems = {0}: debe tener solo elementos únicos en la matriz. | ||
writeOnly = {0}: es un campo de solo escritura, no puede aparecer en los datos | ||
contentEncoding = {0}: no coincide con la codificación del contenido {1} | ||
contentMediaType = {0}: no es un tipo de medio de contenido |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,11 +145,13 @@ void encoding() { | |
expected.put("vi","$: phải dài tối đa 5 ký tự"); | ||
expected.put("zh_CN","$: 长度不得超过 5 个字符"); | ||
expected.put("zh_TW","$: 長度不得超過 5 個字元"); | ||
expected.put("es","$: debe tener como máximo 5 caracteres"); | ||
|
||
// In later JDK versions the numbers will be formatted | ||
Map<String, String> expectedAlternate = new HashMap<>(); | ||
expectedAlternate.put("ar","$: يجب أن يكون طوله ٥ حرفًا على الأكثر"); | ||
expectedAlternate.put("fa","$: باید حداکثر ۵ کاراکتر باشد"); | ||
expectedAlternate.put("es","$: debe tener como máximo 5 caracteres"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this comparison for and how is this possible? The rest of the alternate comparisons is because later JDK versions perform mapping to arabic numerals. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that for Java 8 the properties file must be encoded in ISO 8859-1. UTF-8 is only supported from Java 9 onwards. If the test fails for Java 8 but passes for the rest it means that your file is not encoded in ISO 8859-1. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @justin-tay There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the encoding is correct then remove the expectedAlternate line and the test should pass. If not it's just not encoded correctly and is being corrupted to this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @justin-tay do you prefer any tool for conversion. so that i can verify once more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't prefer any tool, it just need to be encoded such that Java 8 can load it properly. I just use Eclipse which will automatically convert text into ISO 8859-1 when pasted into a properties file as that is the default configuration in Eclipse for the Java Properties File content type. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @justin-tay i tried the same i set my intelij editor to ISO 8859-1, i pasted the converted file and committed now still java 8 is failing. can you please do me a favour for this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @justin-tay can you please give me the converted file. its needed for us There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @justin-tay please let me any help. |
||
|
||
String schemaData = "{\r\n" | ||
+ " \"type\": \"string\",\r\n" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
encoding
test inLocaleTest
needs to be modified to ensure that the encoding of this file works for Java 8.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please le me know how to do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to modify this test.
json-schema-validator/src/test/java/com/networknt/schema/LocaleTest.java
Lines 118 to 125 in ffec188
You also need to modify this to add the supported locale
json-schema-validator/src/main/java/com/networknt/schema/i18n/Locales.java
Lines 33 to 35 in ffec188
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay i will do that and let you know thank you @justin-tay