Skip to content

Commit

Permalink
Code refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
CrisGrud committed Dec 15, 2023
1 parent 6c3fe30 commit 0dcba75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cli/i18n-msg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ const report = (data: Message[], languages:string[])=>{
})
const differentArrOverrides = languages.filter(x => !valueLanguagesOverrites.includes(x))
if(differentArrOverrides[0]){
console.log("Customer: ",("\x1b[31m" + value.code + "\x1b[0m")," is missing the following languages: ", differentArrOverrides)
console.log(" Code: ",("\x1b[31m" + value.code + "\x1b[0m")," Customer: ",("\x1b[31m" + i.customer + "\x1b[0m")," is missing the following languages: ", differentArrOverrides)
}
valueLanguagesOverrites = []
})
const differentArr = languages.filter(x => !valueLanguages.includes(x))
if(differentArr[0]){
console.log("Code: ",("\x1b[31m" + value.code + "\x1b[0m")," is missing the following languages: ", differentArr)
console.log(" Code: ",("\x1b[31m" + value.code + "\x1b[0m")," is missing the following languages: ", differentArr)
}

})
Expand All @@ -222,6 +222,7 @@ const getAllLanguagesUnique = (languages: string[])=>{
}

const multiFileReport = (languages:string[], namespaces:MessagesNamespace[])=>{
console.log()
console.log("-------REPORT-------")
const uniqueLang = getAllLanguagesUnique(languages)
for (const [,messages] of namespaces) {
Expand All @@ -231,6 +232,7 @@ const multiFileReport = (languages:string[], namespaces:MessagesNamespace[])=>{
}

const singleFileReport = (message:Message[],languages:string[])=>{
console.log()
console.log("-----REPORT-------")
const uniqueLang = getAllLanguagesUnique(languages)
report(message,uniqueLang)
Expand Down

0 comments on commit 0dcba75

Please sign in to comment.