Skip to content

Commit 83d7766

Browse files
author
dev-warrior777
committed
client,webserver: more fitting place to inject app.Version
Also: - Translation string 'BUILD ID' is no longer used. - 'BUILD ID' => 'Version' - Translations updated to mean Version - not Build Id. except arabic as I cannot handle the input method to edit arabic as the arrow/BS keys go the wrong way in the editor. And I do not understand how the editor concatenates arabic strings. Meaning left as previously translated: Build Id.
1 parent 874fe24 commit 83d7766

File tree

14 files changed

+19
-24
lines changed

14 files changed

+19
-24
lines changed

client/app/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ type Config struct {
143143
WebConfig
144144
LogConfig
145145
MMConfig
146-
AppVersion string
147146
// AppData and ConfigPath should be parsed from the command-line,
148147
// as it makes no sense to set these in the config file itself. If no values
149148
// are assigned, defaults will be used.
@@ -163,7 +162,7 @@ type Config struct {
163162
// Web creates a configuration for the webserver. This is a Config method
164163
// instead of a WebConfig method because Language is an app-level setting used
165164
// by both core and rpcserver.
166-
func (cfg *Config) Web(c *core.Core, mm *mm.MarketMaker, log dex.Logger, utc bool) *webserver.Config {
165+
func (cfg *Config) Web(c *core.Core, mm *mm.MarketMaker, log dex.Logger, utc bool, appVersion string) *webserver.Config {
167166
addr := cfg.WebAddr
168167
host, _, err := net.SplitHostPort(addr)
169168
if err == nil && host != "" {
@@ -197,6 +196,7 @@ func (cfg *Config) Web(c *core.Core, mm *mm.MarketMaker, log dex.Logger, utc boo
197196
NoEmbed: cfg.NoEmbedSite,
198197
HttpProf: cfg.HTTPProfile,
199198
Language: cfg.Language,
199+
AppVersion: appVersion,
200200
}
201201
}
202202

client/cmd/bisonw-desktop/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func mainCore() error {
222222
}()
223223
}
224224

225-
webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc), cfg.AppVersion)
225+
webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc, app.Version))
226226
if err != nil {
227227
return fmt.Errorf("failed creating web server: %w", err)
228228
}

client/cmd/bisonw-desktop/config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ func configure() (*Config, error) {
4949
return nil, err
5050
}
5151

52-
cfg.AppVersion = app.Version
53-
5452
// Resolve unset fields.
5553
return &cfg, app.ResolveConfig(appData, &cfg.Config)
5654
}

client/cmd/bisonw/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ func configure() (*app.Config, error) {
1313
// or the version flag was specified. Override any environment variables
1414
// with parsed command line flags.
1515
iniCfg := app.DefaultConfig
16-
iniCfg.AppVersion = app.Version
1716
preCfg := iniCfg
1817
if err := app.ParseCLIConfig(&preCfg); err != nil {
1918
return nil, err

client/cmd/bisonw/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func runCore(cfg *app.Config) error {
154154
}
155155

156156
if !cfg.NoWeb {
157-
webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc), cfg.AppVersion)
157+
webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc, app.Version))
158158
if err != nil {
159159
return fmt.Errorf("failed creating web server: %w", err)
160160
}

client/webserver/locales/ar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ var Ar = map[string]*intl.Translation{
137137
"Export Account": {T: "تصدير الحساب"},
138138
"simultaneous_servers_msg": {T: "يدعم عميل منصة المبادلات اللامركزية لديكريد الاستخدام المتزامن لأي عدد من خوادم منصة المبادلات اللامركزية DEX."},
139139
"Change App Password": {T: "تغيير كلمة مرور التطبيق"},
140-
"Build ID": {T: "معرف البنية"},
140+
"Version": {T: "معرف البنية"},
141141
"Connect": {T: "اتصل"},
142142
"Send": {T: "ارسال"},
143143
"Deposit": {T: "إيداع"},

client/webserver/locales/de-de.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ var DeDE = map[string]*intl.Translation{
135135
"Export Account": {T: "Account exportieren"},
136136
"simultaneous_servers_msg": {T: "Der <span class=brand></span> unterstützt die gleichzeitige Nutzung einer beliebigen Anzahl von DEX-Servern."},
137137
"Change App Password": {T: "App-Passwort ändern"},
138-
"Build ID": {T: "Version"},
138+
"Version": {T: "Version"},
139139
"Connect": {T: "Verbinden"},
140140
"Send": {T: "Senden"},
141141
"Deposit": {T: "Einzahlen"},

client/webserver/locales/en-us.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ var EnUS = map[string]*intl.Translation{
167167
"browser_ntfn_blocked": {T: "Browser notifications are currently blocked. Please unblock this site in your browser to receive notifications."},
168168
"enable_browser_ntfn_info": {T: "Desktop notifications appear even when this window is not active. When you have other applications open this can be helpful as you will be notified on DCRDEX events. Customize below the types of notifications you would like to receive."},
169169
"Save Notifications": {T: "Save Notifications"},
170-
"Build ID": {T: "Version"},
170+
"Version": {T: "Version"},
171171
"Connect": {T: "Connect"},
172172
"Send": {T: "Send"},
173173
"Deposit": {T: "Deposit"}, // unused

client/webserver/locales/pl-pl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ var PlPL = map[string]*intl.Translation{
133133
"Export Account": {T: "Eksportuj konto"},
134134
"simultaneous_servers_msg": {T: "Klient Decred DEX wspiera jednoczesne korzystanie z wielu serwerów DEX."},
135135
"Change App Password": {T: "Zmień hasło aplikacji"},
136-
"Build ID": {T: "Wersja"},
136+
"Version": {T: "Wersja"},
137137
"Connect": {T: "Połącz"},
138138
"Withdraw": {T: "Wypłać"},
139139
"Deposit": {T: "Zdeponuj"},

client/webserver/locales/pt-br.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ var PtBr = map[string]*intl.Translation{
133133
"Export Account": {T: "Exportar Conta"},
134134
"simultaneous_servers_msg": {T: "O cliente da DEX suporta simultâneos números de servidores DEX."},
135135
"Change App Password": {T: "Trocar Senha do aplicativo"},
136-
"Build ID": {T: "Versão"},
136+
"Version": {T: "Versão"},
137137
"Connect": {T: "Conectar"},
138138
"Withdraw": {T: "Retirar"},
139139
"Deposit": {T: "Depositar"},

0 commit comments

Comments
 (0)