diff --git a/locales/ar.yml b/locales/ar.yml index 4847bbd1..95d9fa73 100644 --- a/locales/ar.yml +++ b/locales/ar.yml @@ -2923,6 +2923,8 @@ tools: label-json-schema: "مخطط JSON:" placeholder-paste-your-json-schema-here: قم بلصق مخطط JSON الخاص بك هنا... title-schema-validation-errors: أخطاء التحقق من صحة المخطط + title-formatted-version: النسخة المنسقة + label-indent-size-0-compact: "حجم المسافة البادئة (0 = مضغوط):" json-size-analyzer: title: محلل حجم JSON description: قياس الأوزان النسبية لعقد JSON diff --git a/locales/da.yml b/locales/da.yml index 9b1b9706..1a609396 100644 --- a/locales/da.yml +++ b/locales/da.yml @@ -2860,6 +2860,8 @@ tools: label-json-schema: "JSON-skema:" placeholder-paste-your-json-schema-here: Indsæt dit JSON-skema her... title-schema-validation-errors: Fejl ved skemavalidering + title-formatted-version: Formateret version + label-indent-size-0-compact: "Indrykningsstørrelse (0 = Kompakt):" json-size-analyzer: title: Json-størrelsesanalysator description: Mål JSON-noders relative vægte diff --git a/locales/de.yml b/locales/de.yml index 6de5ad58..7f0aa7f5 100644 --- a/locales/de.yml +++ b/locales/de.yml @@ -3159,6 +3159,8 @@ tools: label-json-schema: "JSON-Schema:" placeholder-paste-your-json-schema-here: Fügen Sie hier Ihr JSON-Schema ein ... title-schema-validation-errors: Schemavalidierungsfehler + title-formatted-version: Formatierte Version + label-indent-size-0-compact: "Einrückungsgröße (0 = Kompakt):" json-size-analyzer: title: JSON-Größenanalysator description: Messen Sie die relativen Gewichte von JSON-Knoten diff --git a/locales/en.yml b/locales/en.yml index 7f2fab42..d460424e 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -2345,6 +2345,8 @@ tools: label-json-schema: "JSON schema:" placeholder-paste-your-json-schema-here: Paste your JSON Schema here... title-schema-validation-errors: Schema Validation Errors + title-formatted-version: Formatted version + label-indent-size-0-compact: "Indent size (0 = Compact):" json-size-analyzer: title: Json Size Analyzer description: Measure JSON nodes relative weights diff --git a/locales/es.yml b/locales/es.yml index 702e4e7e..f17c8e38 100644 --- a/locales/es.yml +++ b/locales/es.yml @@ -2416,6 +2416,8 @@ tools: label-json-schema: "Esquema JSON:" placeholder-paste-your-json-schema-here: Pegue su esquema JSON aquí... title-schema-validation-errors: Errores de validación del esquema + title-formatted-version: Versión formateada + label-indent-size-0-compact: "Tamaño de sangría (0 = Compacto):" json-size-analyzer: title: Analizador de tamaño JSON description: Medir los pesos relativos de los nodos JSON diff --git a/locales/fr.yml b/locales/fr.yml index 6bc6004a..4e49538b 100644 --- a/locales/fr.yml +++ b/locales/fr.yml @@ -3325,6 +3325,8 @@ tools: tag-validation-successful: Validation réussi ! title-schema-validation-errors: Erreurs de validation du schéma title-the-following-errors-occured: Les erreurs suivantes se sont produites + title-formatted-version: Version formatée + label-indent-size-0-compact: "Taille du retrait (0 = Compact) :" title: Linter JSON json-merger: description: Fusionner profondément deux contenus JSON diff --git a/locales/ga.yml b/locales/ga.yml index 33e2a409..d167e16a 100644 --- a/locales/ga.yml +++ b/locales/ga.yml @@ -3200,6 +3200,8 @@ tools: label-json-schema: "Scéim JSON:" placeholder-paste-your-json-schema-here: Greamaigh do Scéim JSON anseo... title-schema-validation-errors: Earráidí Bailíochtaithe Scéime + title-formatted-version: Leagan formáidithe + label-indent-size-0-compact: "Méid an línithe (0 = Dlúth):" json-size-analyzer: title: Anailíseoir Méid Json description: Tomhas meáchain choibhneasta nóid JSON diff --git a/locales/it.yml b/locales/it.yml index abed49e1..209e3d4e 100644 --- a/locales/it.yml +++ b/locales/it.yml @@ -2928,6 +2928,8 @@ tools: label-json-schema: "Schema JSON:" placeholder-paste-your-json-schema-here: Incolla qui il tuo schema JSON... title-schema-validation-errors: Errori di convalida dello schema + title-formatted-version: Versione formattata + label-indent-size-0-compact: "Dimensione rientro (0 = Compatto):" json-size-analyzer: title: Analizzatore di dimensioni JSON description: Misura i pesi relativi dei nodi JSON diff --git a/locales/ko.yml b/locales/ko.yml index af2bc954..44bdae9e 100644 --- a/locales/ko.yml +++ b/locales/ko.yml @@ -2699,6 +2699,8 @@ tools: label-json-schema: "JSON 스키마:" placeholder-paste-your-json-schema-here: JSON 스키마를 여기에 붙여넣으세요... title-schema-validation-errors: 스키마 유효성 검사 오류 + title-formatted-version: 포맷된 버전 + label-indent-size-0-compact: "들여쓰기 크기(0 = 압축):" json-size-analyzer: title: JSON 크기 분석기 description: JSON 노드의 상대적 가중치 측정 diff --git a/locales/nl.yml b/locales/nl.yml index ebd571aa..0a687952 100644 --- a/locales/nl.yml +++ b/locales/nl.yml @@ -2895,6 +2895,8 @@ tools: label-json-schema: "JSON-schema:" placeholder-paste-your-json-schema-here: Plak hier uw JSON-schema... title-schema-validation-errors: Schemavalidatiefouten + title-formatted-version: Geformatteerde versie + label-indent-size-0-compact: "Inspringingsgrootte (0 = Compact):" json-size-analyzer: title: Json-grootte-analysator description: Meet de relatieve gewichten van JSON-knooppunten diff --git a/locales/no.yml b/locales/no.yml index d1f2eb03..c3eb79a3 100644 --- a/locales/no.yml +++ b/locales/no.yml @@ -2936,6 +2936,8 @@ tools: label-json-schema: "JSON-skjema:" placeholder-paste-your-json-schema-here: Lim inn JSON-skjemaet ditt her ... title-schema-validation-errors: Skjemavalideringsfeil + title-formatted-version: Formatert versjon + label-indent-size-0-compact: "Innrykksstørrelse (0 = Kompakt):" json-size-analyzer: title: Json-størrelsesanalysator description: Mål relative vekter av JSON-noder diff --git a/locales/pl.yml b/locales/pl.yml index db0901c8..d7a0407b 100644 --- a/locales/pl.yml +++ b/locales/pl.yml @@ -2415,6 +2415,8 @@ tools: label-json-schema: "Schemat JSON:" placeholder-paste-your-json-schema-here: Wklej tutaj swój schemat JSON... title-schema-validation-errors: Błędy walidacji schematu + title-formatted-version: Wersja sformatowana + label-indent-size-0-compact: "Rozmiar wcięcia (0 = Kompaktowy):" json-size-analyzer: title: Analizator rozmiaru JSON description: Pomiar względnych wag węzłów JSON diff --git a/locales/pt.yml b/locales/pt.yml index 256e0253..a90647c2 100644 --- a/locales/pt.yml +++ b/locales/pt.yml @@ -2401,6 +2401,8 @@ tools: label-json-schema: "Esquema JSON:" placeholder-paste-your-json-schema-here: Cole seu esquema JSON aqui... title-schema-validation-errors: Erros de validação de esquema + title-formatted-version: Versão formatada + label-indent-size-0-compact: "Tamanho do recuo (0 = Compacto):" json-size-analyzer: title: Analisador de tamanho JSON description: Medir pesos relativos de nós JSON diff --git a/locales/ru.yml b/locales/ru.yml index 68c3403e..fefdf30f 100644 --- a/locales/ru.yml +++ b/locales/ru.yml @@ -3257,6 +3257,8 @@ tools: label-json-schema: "Схема JSON:" placeholder-paste-your-json-schema-here: Вставьте сюда вашу схему JSON... title-schema-validation-errors: Ошибки проверки схемы + title-formatted-version: Форматированная версия + label-indent-size-0-compact: "Размер отступа (0 = Компактный):" json-size-analyzer: title: Анализатор размера JSON description: Измеряйте относительный вес узлов JSON diff --git a/locales/tr.yml b/locales/tr.yml index 188c2712..409bb060 100644 --- a/locales/tr.yml +++ b/locales/tr.yml @@ -2638,6 +2638,8 @@ tools: label-json-schema: "JSON şeması:" placeholder-paste-your-json-schema-here: JSON Şemanızı buraya yapıştırın... title-schema-validation-errors: Şema Doğrulama Hataları + title-formatted-version: Biçimlendirilmiş sürüm + label-indent-size-0-compact: "Girinti boyutu (0 = Sıkıştırılmış):" json-size-analyzer: title: Json Boyut Analizcisi description: JSON düğümlerinin göreceli ağırlıklarını ölçün diff --git a/locales/uk.yml b/locales/uk.yml index 44536b5f..f44dcf71 100644 --- a/locales/uk.yml +++ b/locales/uk.yml @@ -3237,6 +3237,8 @@ tools: label-json-schema: "Схема JSON:" placeholder-paste-your-json-schema-here: Вставте сюди свою JSON-схему... title-schema-validation-errors: Помилки перевірки схеми + title-formatted-version: Відформатована версія + label-indent-size-0-compact: "Розмір відступу (0 = Компактний):" json-size-analyzer: title: Аналізатор розміру JSON description: Вимірюйте відносну вагу вузлів JSON diff --git a/locales/vi.yml b/locales/vi.yml index f3b0a272..1d22dc27 100644 --- a/locales/vi.yml +++ b/locales/vi.yml @@ -2930,6 +2930,8 @@ tools: label-json-schema: "Sơ đồ JSON:" placeholder-paste-your-json-schema-here: Dán Sơ đồ JSON của bạn vào đây... title-schema-validation-errors: Lỗi xác thực lược đồ + title-formatted-version: Phiên bản đã định dạng + label-indent-size-0-compact: "Kích thước thụt lề (0 = Nhỏ gọn):" json-size-analyzer: title: Trình phân tích kích thước JSON description: Đo trọng số tương đối của các nút JSON diff --git a/locales/zh.yml b/locales/zh.yml index 38345068..fa42e091 100644 --- a/locales/zh.yml +++ b/locales/zh.yml @@ -2270,6 +2270,8 @@ tools: label-json-schema: JSON 模式: placeholder-paste-your-json-schema-here: 将您的 JSON 模式粘贴到这里... title-schema-validation-errors: 架构验证错误 + title-formatted-version: 格式化版本 + label-indent-size-0-compact: 缩进大小(0 = 紧凑): json-size-analyzer: title: JSON大小分析器 description: 测量JSON节点的相对权重 diff --git a/src/tools/json-linter/json-linter.vue b/src/tools/json-linter/json-linter.vue index 2bf92c90..de8ebf4e 100644 --- a/src/tools/json-linter/json-linter.vue +++ b/src/tools/json-linter/json-linter.vue @@ -34,6 +34,16 @@ const MONACO_EDITOR_OPTIONS = { const schemaUrl = useQueryParamOrStorage({ name: 'schema', storageName: 'json-linter:schema', defaultValue: '' }); const { schemas, errors: validationErrors } = useJsonSchemaValidation({ json: jsonContent, schemaUrl, schemaData }); + +const indentSize = useITStorage('json-linter:indent-size', 3); +const cleanJson = computed(() => { + try { + return JSON.stringify(JSON.parseBigInt(jsonContent.value), null, indentSize.value); + } + catch (e: any) { + return e.toString(); + } +});