Skip to content

Commit

Permalink
translation: minor safety for setting languages
Browse files Browse the repository at this point in the history
  • Loading branch information
abenz1267 committed Jan 12, 2025
1 parent 4ce4a8d commit bb0c156
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions internal/modules/translation/translation.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,23 @@ func (translation *Translation) Entries(term string) []util.Entry {
if len(splits[0]) == 2 {
src = splits[0]
term = splits[1]
} else {
}

if len(splits[1]) == 2 {
dest = splits[1]
term = splits[0]
}
}

if len(splits) == 3 {
src = splits[0]
dest = splits[2]
if len(splits[0]) == 2 {
src = splits[0]
}

if len(splits[2]) == 2 {
dest = splits[2]
}

term = splits[1]
}

Expand Down

0 comments on commit bb0c156

Please sign in to comment.