Skip to content

Commit

Permalink
add support for more languages
Browse files Browse the repository at this point in the history
  • Loading branch information
shibumi committed Sep 6, 2020
1 parent 2399605 commit 43919d0
Show file tree
Hide file tree
Showing 2 changed files with 269 additions and 5 deletions.
256 changes: 252 additions & 4 deletions assets.go

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ func newWordList(language string, file string) (list []string, err error) {
switch language {
case "de":
assetFile = "data/german.txt"
case "cz":
assetFile = "data/czech.txt"
case "jp":
assetFile = "data/japanese.txt"
case "kr":
assetFile = "data/korean.txt"
case "fr":
assetFile = "data/french.txt"
case "it":
assetFile = "data/italian.txt"
case "es":
assetFile = "data/spanish.txt"
case "zh-cn":
assetFile = "data/chinese_simplified.txt"
case "zh-tw":
assetFile = "data/chinese_traditional.txt"
default:
assetFile = "data/english.txt"
}
Expand Down Expand Up @@ -57,7 +73,7 @@ func generatePassword(n uint, d string, list []string) (pw string) {
func main() {
numberOfWords := flag.Uint("n", 3, "number of words")
delimiter := flag.String("d", "-", "delimiter as split element for the password")
language := flag.String("l", "en", "language of word list: [en, de]")
language := flag.String("l", "en", "language of word list: [en, de, cz, jp, kr, it, es, fr, zh-cn, zh-tw]")
file := flag.String("f", "", "path to external word list")
flag.Parse()

Expand Down

0 comments on commit 43919d0

Please sign in to comment.