Fix separator to avoid extra merge conflicts

This commit is contained in:
Andrii Shvaika 2025-05-19 17:08:13 +03:00
parent a1ad345f86
commit 09854dcb76
6 changed files with 46033 additions and 16158 deletions

View File

@ -1,8 +1,14 @@
package org.thingsboard.client.tools.i18n; package org.thingsboard.client.tools.i18n;
import com.fasterxml.jackson.core.FormatFeature;
import com.fasterxml.jackson.core.PrettyPrinter;
import com.fasterxml.jackson.core.util.Separators;
import com.fasterxml.jackson.core.util.Separators.Spacing;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -73,8 +79,9 @@ public class TranslationPruner {
throw new IllegalArgumentException("Source JSON must be an object at root"); throw new IllegalArgumentException("Source JSON must be an object at root");
} }
ObjectNode pruned = pruneNode((ObjectNode) sourceRoot, validKeys, "", mapper); ObjectNode pruned = pruneNode((ObjectNode) sourceRoot, validKeys, "", mapper);
Separators seps = Separators.createDefaultInstance()
mapper.writerWithDefaultPrettyPrinter().writeValue(destFile, pruned); .withObjectFieldValueSpacing(Spacing.AFTER);
mapper.writer(new DefaultPrettyPrinter().withSeparators(seps)).writeValue(destFile, pruned);
System.out.println("Pruned translation written to " + destFile.getPath()); System.out.println("Pruned translation written to " + destFile.getPath());
} }
} catch (IOException e) { } catch (IOException e) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff