Commit e4bf72e6 authored by 王品堯's avatar 王品堯

改變檔案名稱符合目的

parent 75f97ae2
# JsonFileCompare
# LanguageFileCompare
### Find missing key in Target json file
### Find missing key in Target files
```
mvn package
......@@ -8,8 +8,9 @@ mvn package
可以在target下找到JsonFileCompare-exec.jar
```java
java -cp JsonFileCompare-exec.jar JsonFileCompare /xxx/locale-zh_TW.json /xxx/locale-zh_CN.json /xxx/locale-en_US.json
```
java -cp LanguageFileCompare-exec.jar LanguageFileCompare /xxx/locale-zh_TW.json /xxx/locale-zh_CN.json /xxx/locale-en_US.json
```
P.S 第一個參數為基準的json, 後面為要找出缺少key的目標檔案
* 第一個參數為基準的json, 後面為要找出缺少key的目標檔案
* 增加檢查專案src/main/resources/i18n下的properties檔案
......@@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.ylhealth</groupId>
<artifactId>JsonFileCompare</artifactId>
<artifactId>LanguageFileCompare</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
......@@ -45,7 +45,7 @@
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<finalName>JsonFileCompare-exec</finalName>
<finalName>LanguageFileCompare-exec</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</plugin>
......
......@@ -13,8 +13,8 @@ import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class JsonFileCompare {
private static Logger log = LoggerFactory.getLogger(JsonFileCompare.class);
public class LanguageFileCompare {
private static Logger log = LoggerFactory.getLogger(LanguageFileCompare.class);
public static void main(String[] args) {
try {
......@@ -87,9 +87,9 @@ public class JsonFileCompare {
Map<String, List<String>> map =
Arrays.stream(
Optional.ofNullable(
Paths.get(path).toFile().list((dir, name) -> name.endsWith(extension)))
.orElse(new String[0]))
Optional.ofNullable(
Paths.get(path).toFile().list((dir, name) -> name.endsWith(extension)))
.orElse(new String[0]))
.map(s -> s.split(extension)[0])
.collect(
Collectors.groupingBy(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment