Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
LanguageFileCompare
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
測試專案
LanguageFileCompare
Commits
e4bf72e6
Commit
e4bf72e6
authored
Nov 27, 2018
by
王品堯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改變檔案名稱符合目的
parent
75f97ae2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
README.md
README.md
+6
-5
pom.xml
pom.xml
+2
-2
src/main/java/LanguageFileCompare.java
src/main/java/LanguageFileCompare.java
+5
-5
No files found.
README.md
View file @
e4bf72e6
#
Json
FileCompare
#
Language
FileCompare
### 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
Json
FileCompare
/
xxx
/
locale
-
zh_TW
.
json
/
xxx
/
locale
-
zh_CN
.
json
/
xxx
/
locale
-
en_US
.
json
```
java -cp
LanguageFileCompare-exec.jar Language
FileCompare /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檔案
pom.xml
View file @
e4bf72e6
...
...
@@ -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>
Json
FileCompare
</artifactId>
<artifactId>
Language
FileCompare
</artifactId>
<version>
0.0.1
</version>
<packaging>
jar
</packaging>
...
...
@@ -45,7 +45,7 @@
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
<finalName>
Json
FileCompare-exec
</finalName>
<finalName>
Language
FileCompare-exec
</finalName>
<appendAssemblyId>
false
</appendAssemblyId>
</configuration>
</plugin>
...
...
src/main/java/
Json
FileCompare.java
→
src/main/java/
Language
FileCompare.java
View file @
e4bf72e6
...
...
@@ -13,8 +13,8 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
java.util.stream.IntStream
;
public
class
Json
FileCompare
{
private
static
Logger
log
=
LoggerFactory
.
getLogger
(
Json
FileCompare
.
class
);
public
class
Language
FileCompare
{
private
static
Logger
log
=
LoggerFactory
.
getLogger
(
Language
FileCompare
.
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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment