Refactor to parseAllWords()

This commit is contained in:
Gucheng Wang
2023-03-18 14:16:15 +08:00
parent 28d24cc913
commit d383de256b
2 changed files with 26 additions and 26 deletions

View File

@ -99,7 +99,7 @@ func getAllFilePathsInFolder(folder string, fileSuffix string) []string {
return res
}
func parseEnData(category string) *I18nData {
func parseAllWords(category string) *I18nData {
var paths []string
if category == "backend" {
paths = getAllFilePathsInFolder("../", ".go")
@ -137,10 +137,10 @@ func parseEnData(category string) *I18nData {
return &data
}
func applyToOtherLanguage(category string, language string, i18nData *I18nData) {
newData := readI18nFile(category, language)
println(newData)
func applyToOtherLanguage(category string, language string, newData *I18nData) {
oldData := readI18nFile(category, language)
println(oldData)
applyData(i18nData, newData)
writeI18nFile(category, language, i18nData)
applyData(newData, oldData)
writeI18nFile(category, language, newData)
}