Skip to content

Commit

Permalink
Fixes #157, add list of translations to help text.
Browse files Browse the repository at this point in the history
  • Loading branch information
xxxserxxx committed Jan 26, 2021
1 parent 2f0eca1 commit 18c07d8
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 20 deletions.
9 changes: 9 additions & 0 deletions cmd/gotop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ func parseArgs() error {
fmt.Println(tr.Value("help.help"))
case "widgets":
fmt.Println(tr.Value("help.widgets"))
case "langs":
vs, err := translations.AssetDir("")
if err != nil {
return err
}
for _, v := range vs {
v = strings.TrimSuffix(v, ".toml")
fmt.Println(v)
}
default:
fmt.Printf(tr.Value("error.unknownopt", *list))
os.Exit(1)
Expand Down
20 changes: 10 additions & 10 deletions translations/dicts.go

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions translations/dicts/de_DE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ mbps="Netzwerkrate als MBit / s anzeigen."
test="Führt Tests aus und beendet das Programm mit Erfolgs- / Fehlercode."
conffile="Konfigurationsdatei, die anstelle der Standardeinstellung verwendet werden soll (MUSS DAS ERSTE ARGUMENT SEIN)"
list="""
List <devices|layouts|colorschemes|paths|keys>
List <devices|layouts|colorschemes|paths|keys|langs>
devices: Druckt Gerätenamen für filterbare Widgets aus
layouts: Listet integrierte Layouts auf
colorschemes: Listet integrierte Farbschemata auf
paths: Listen Sie die Suchpfade für Konfigurationsdateien auf
widgets: Widgets, die in einem Layout verwendet werden können
keys: Zeigen Sie die Tastaturbindungen an."""
keys: Zeigen Sie die Tastaturbindungen an.
langs: Unterstützte Sprachübersetzungen anzeigen."""
write="Schreiben Sie eine Standardkonfigurationsdatei."


Expand Down
5 changes: 3 additions & 2 deletions translations/dicts/en_US.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ test="Runs tests and exits with success/failure code."
conffile="Config file to use instead of default (MUST BE FIRST ARGUMENT)"
# TRANSLATORS: Please don't translate the **labels** ("devices", "layouts") as they don't change in the code.
list="""
List <devices|layouts|colorschemes|paths|keys>
List <devices|layouts|colorschemes|paths|keys|langs>
devices: Prints out device names for filterable widgets
layouts: Lists built-in layouts
colorschemes: Lists built-in colorschemes
paths: List out configuration file search paths
widgets: Widgets that can be used in a layout
keys: Show the keyboard bindings."""
keys: Show the keyboard bindings.
langs: Show supported language translations."""
write="Write out a default config file."


Expand Down
5 changes: 3 additions & 2 deletions translations/dicts/eo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ test="Ekzekutas testojn kaj forirojn kun sukceso / fiaska kodo."
conffile="Agordi dosiero por uzi anstataŭ defaŭlte (DEVAS ESTI UNUA ARGUMENTO)"
# TRANSLATORS: Please don't translate the list entries
list="""
List <devices|layouts|colorschemes|paths|keys>
List <devices|layouts|colorschemes|paths|keys|langs>
devices: Montras nomojn de aparatoj por filteblaj fenestraĵoj
layouts: Listigas enkonstruajn aranĝojn
colorschemes: Listas enkonstruitajn kloraj skemoj
paths: Enlistigu agordajn serĉajn vojojn de agordo
widgets: Fenestraĵoj uzeblaj en aranĝo
keys: Montri la klavarajn ligojn."""
keys: Montri la klavarajn ligojn.
langs: Montru subtenatajn lingvajn tradukojn."""
write="Skribu defaŭltan agordan dosieron."


Expand Down
5 changes: 3 additions & 2 deletions translations/dicts/tt_TT.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ mbps=".spbm sa etar krowten wohS"
test=".edoc eruliaf/sseccus htiw stixe dna stset snuR"
conffile=")TNEMUGRA TSRIF EB TSUM( tluafed fo daetsni esu ot elif gifnoC"
list="""
>syek|shtap|semehcsroloc|stuoyal|secived< tsiL
>snart|syek|shtap|semehcsroloc|stuoyal|secived< tsiL
stegdiw elbaretlif rof seman ecived tuo stnirP :secived
stuoyal ni-dliub stsiL :stuoyal
semehcsroloc ni-tliub stsiL :semehcsroloc
shtap hcraes elif noitarugifnoc tuo tsiL :shtap
tuoyal a ni desu eb nac taht stegdiW :stegdiw
.sgnidnib draobyek eht wohS :syek """
.sgnidnib draobyek eht wohS :syek
.snoitalsnart egaugnal detroppus wohS :sgnal"""
write=".elif gifnoc tluafed a tuo etirW"


Expand Down
5 changes: 3 additions & 2 deletions translations/dicts/zh_CN.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ mbps="显示网速为 mbps。"
test="执行测试并返回成功或失败码。"
conffile="用于替代缺省参数的配置文件(必须是第一个参数)"
list="""
列出 <devices|layouts|colorschemes|paths|keys>
列出 <devices|layouts|colorschemes|paths|keys|langs>
devices: 显示可用于过滤的设备名
layouts: 列出所有内置布局方案
colorschemes: 列出所有内置配色方案
paths: 列出配置文件的搜索路径
widgets: 所有可被用于布局的组件
keys: 显示所有热键。"""
keys: 显示所有热键
langs: 显示支持的语言翻译."""
write="将当前配置写入缺省配置文件。"


Expand Down

0 comments on commit 18c07d8

Please sign in to comment.