add get_required_translations.go
parent
df7f9c4a99
commit
cfd47b2877
@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"github.com/jesseduffield/lazydocker/pkg/i18n"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println(getOutstandingTranslations())
|
||||
}
|
||||
|
||||
// adapted from https://github.com/a8m/reflect-examples#read-struct-tags
|
||||
func getOutstandingTranslations() string {
|
||||
output := ""
|
||||
for languageCode, translationSet := range i18n.GetTranslationSets() {
|
||||
output += languageCode + ":\n"
|
||||
v := reflect.ValueOf(translationSet)
|
||||
|
||||
for i := 0; i < v.NumField(); i++ {
|
||||
value := v.Field(i).String()
|
||||
if value == "" {
|
||||
output += v.Type().Field(i).Name + "\n"
|
||||
}
|
||||
}
|
||||
output += "\n"
|
||||
}
|
||||
return output
|
||||
}
|
Loading…
Reference in New Issue