Skip to content

Commit

Permalink
add entry for missing neutral language
Browse files Browse the repository at this point in the history
  • Loading branch information
jtorvald committed May 30, 2022
1 parent 666160d commit 614d435
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,22 @@ func importResx(resxFileName, outputPath string) (bool, error) {
return false, err
}
for _, v := range translationRoot.Data {
if newData[v.Name].translations == nil {
orderedKeys = append(orderedKeys, v.Name)

fmt.Println(v.Name, "does not exist in neutral language")
newData[v.Name] = translation{
name: fileName,
key: v.Name,
neutral: "MISSING",
comment: "WARNING",
translations: map[string]string{},
}
}
newData[v.Name].translations[code] = v.Value
}
}

//for k, v := range newData {
// fmt.Println(k, v.key, v.neutral, v.translations, v.comment)
//}

err = writeExcelFile(filepath.Join(outputPath, fileName+".xlsx"), fileName, newData, orderedKeys)
if err != nil {
return false, err
Expand Down

0 comments on commit 614d435

Please sign in to comment.