Skip to content

Commit

Permalink
Translate syntax and schema errors to Italian
Browse files Browse the repository at this point in the history
Also clarify English wording of two error messages
  • Loading branch information
molsonkiko committed Jul 16, 2024
1 parent 8d119a2 commit e52ac03
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 96 deletions.
2 changes: 1 addition & 1 deletion JsonToolsNppPlugin/JSONTools/JsonParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public string TranslateMessageIfDesired(bool translated)
case JsonLintType.FATAL_INVALID_STARTSWITH_u: return Translator.TranslateLintMessage(translated, lintType, "Expected literal starting with 'u' to be undefined");
case JsonLintType.FATAL_BADLY_LOCATED_CHAR: return TryTranslateWithOneParam(translated, lintType, "Badly located character {0}", param1);
case JsonLintType.FATAL_NO_INPUT: return Translator.TranslateLintMessage(translated, lintType, "No input");
case JsonLintType.FATAL_ONLY_WHITESPACE_COMMENTS: return Translator.TranslateLintMessage(translated, lintType, "Json string is only whitespace and maybe comments");
case JsonLintType.FATAL_ONLY_WHITESPACE_COMMENTS: return Translator.TranslateLintMessage(translated, lintType, "Input is only whitespace and maybe comments");
case JsonLintType.FATAL_JSONL_NOT_ONE_DOC_PER_LINE: return Translator.TranslateLintMessage(translated, lintType, "JSON Lines document does not contain exactly one JSON document per line");
// FATAL messages that wrap an exception
case JsonLintType.FATAL_UNSPECIFIED_ERROR:
Expand Down
2 changes: 1 addition & 1 deletion JsonToolsNppPlugin/JSONTools/JsonSchemaValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static JsonLint ValidationProblemToLint(JsonLintType problemType, Dictio
break;
case JsonLintType.SCHEMA_OBJECT_MISSING_REQUIRED_KEY:
string keyMissing = (string)keywords["required"];
msg = JsonLint.TryTranslateWithOneParam(translated, problemType, "object missing required key {0}", keyMissing);
msg = JsonLint.TryTranslateWithOneParam(translated, problemType, "object missing \"required\" key {0}", keyMissing);
break;
case JsonLintType.SCHEMA_FALSE_SCHEMA:
msg = Translator.TranslateLintMessage(translated, problemType, "the schema is `false`, so nothing will validate.");
Expand Down
4 changes: 2 additions & 2 deletions JsonToolsNppPlugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("8.0.0.7")]
[assembly: AssemblyFileVersion("8.0.0.7")]
[assembly: AssemblyVersion("8.0.0.8")]
[assembly: AssemblyFileVersion("8.0.0.8")]
2 changes: 1 addition & 1 deletion JsonToolsNppPlugin/Tests/JsonParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ public static bool TestLinter()
}),
("\"\\i\"", "\"i\"", new string[]{"Escaped char 'i' is only valid in JSON5"}),
("", "null", new string[]{"No input"}),
("\t\r\n // comments\r\n/* */ ", "null", new string[]{ "JavaScript comments are not part of the original JSON specification", "JavaScript comments are not part of the original JSON specification","Json string is only whitespace and maybe comments" }),
("\t\r\n // comments\r\n/* */ ", "null", new string[]{ "JavaScript comments are not part of the original JSON specification", "JavaScript comments are not part of the original JSON specification","Input is only whitespace and maybe comments" }),
("[5/ ]", "[5]", new string[]{ "JavaScript comments are not part of the original JSON specification", "Expected JavaScript comment after '/'" }),
("\xa0\u2028\u2029\ufeff\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\"\xa0\u2028\u2029\ufeff\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\"", "\"\xa0\u2028\u2029\ufeff\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\"", new string[]
{
Expand Down
6 changes: 3 additions & 3 deletions translation/english.json5
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@
"JSON5_NUM_LEADING_DECIMAL_POINT": "Numbers with a leading decimal point are only part of JSON5",
"JSON5_COMMA_AFTER_LAST_ELEMENT_ARRAY": "Comma after last element of array",
"JSON5_COMMA_AFTER_LAST_ELEMENT_OBJECT": "Comma after last key-value pair of object",
// ============== BAD messages ==============
"JSON5_NUM_TRAILING_DECIMAL_POINT": "Numbers with a trailing decimal point are only part of JSON5",
// ============== BAD messages ==============
"BAD_UNTERMINATED_MULTILINE_COMMENT": "Unterminated multi-line comment",
"BAD_PYTHON_COMMENT": "Python-style '#' comments are not part of any well-accepted JSON specification",
"BAD_STRING_CONTAINS_NEWLINE": "String literal contains newline",
Expand Down Expand Up @@ -332,7 +332,7 @@
"FATAL_INVALID_STARTSWITH_u": "Expected literal starting with 'u' to be undefined",
"FATAL_BADLY_LOCATED_CHAR": "Badly located character {0}",
"FATAL_NO_INPUT": "No input",
"FATAL_ONLY_WHITESPACE_COMMENTS": "Json string is only whitespace and maybe comments",
"FATAL_ONLY_WHITESPACE_COMMENTS": "Input is only whitespace and maybe comments",
"FATAL_JSONL_NOT_ONE_DOC_PER_LINE": "JSON Lines document does not contain exactly one JSON document per line",
// ============== SCHEMA messages ==============
"SCHEMA_TYPE_MISMATCH": "found type {0}, expected type {1}.",
Expand All @@ -342,7 +342,7 @@
"SCHEMA_ARRAY_TOO_SHORT": "array required to have at least {0} items, but it has {1} items.",
"SCHEMA_CONTAINS_VIOLATION": "Array must have between {0} and {1} items that match \"contains\" schema {2}",
"SCHEMA_MINCONTAINS_VIOLATION": "Array must have at least {0} items that match \"contains\" schema {1}",
"SCHEMA_OBJECT_MISSING_REQUIRED_KEY": "object missing required key {0}",
"SCHEMA_OBJECT_MISSING_REQUIRED_KEY": "object missing \"required\" key {0}",
"SCHEMA_FALSE_SCHEMA": "the schema is `false`, so nothing will validate.",
"SCHEMA_STRING_DOESNT_MATCH_PATTERN": "string '{0}' does not match regex '{1}'",
"SCHEMA_RECURSION_LIMIT_REACHED": "validation has a maximum depth of 128",
Expand Down
Loading

0 comments on commit e52ac03

Please sign in to comment.