Skip to content

Commit c298ca2

Browse files
author
dev-warrior777
committed
client,webserver: Use the app build version as Version in UI.
- Use the value from client/app/version.go - Place at the foot of Settings dialog - Re-purpose 'BUILD ID' as "Version for translations and find relevant translations
1 parent 3a211e7 commit c298ca2

File tree

18 files changed

+60
-46
lines changed

18 files changed

+60
-46
lines changed

client/app/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ type Config struct {
143143
WebConfig
144144
LogConfig
145145
MMConfig
146+
AppVersion string
146147
// AppData and ConfigPath should be parsed from the command-line,
147148
// as it makes no sense to set these in the config file itself. If no values
148149
// are assigned, defaults will be used.
@@ -348,6 +349,7 @@ func ResolveConfig(appData string, cfg *Config) error {
348349
if cfg.MMConfig.EventLogDBPath == "" {
349350
cfg.MMConfig.EventLogDBPath = defaultMMEventLogDBPath
350351
}
352+
351353
return nil
352354
}
353355

client/cmd/bisonw/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ 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
1617
preCfg := iniCfg
1718
if err := app.ParseCLIConfig(&preCfg); err != nil {
1819
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))
157+
webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc), cfg.AppVersion)
158158
if err != nil {
159159
return fmt.Errorf("failed creating web server: %w", err)
160160
}

client/webserver/http.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,15 @@ func (s *WebServer) handleSettings(w http.ResponseWriter, r *http.Request) {
260260
FiatCurrency string
261261
Exchanges map[string]*core.Exchange
262262
IsInitialized bool
263+
AppVersion string
263264
}{
264265
CommonArguments: *common,
265266
KnownExchanges: s.knownUnregisteredExchanges(xcs),
266267
FiatCurrency: core.DefaultFiatCurrency,
267268
FiatRateSources: s.core.FiatRateSources(),
268269
Exchanges: xcs,
269270
IsInitialized: s.core.IsInitialized(),
271+
AppVersion: s.appVersion,
270272
}
271273
s.sendTemplate(w, "settings", data)
272274
}

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: "Build ID"},
138+
"Build ID": {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: "Build ID"},
170+
"Build ID": {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: "ID builda"},
136+
"Build ID": {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: "ID da Build"},
136+
"Build ID": {T: "Versão"},
137137
"Connect": {T: "Conectar"},
138138
"Withdraw": {T: "Retirar"},
139139
"Deposit": {T: "Depositar"},

client/webserver/locales/zh-cn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ var ZhCN = map[string]*intl.Translation{
135135
"Export Account": {T: "退出账户"},
136136
"simultaneous_servers_msg": {T: "Decred DEX 客户端支持同时使用任意数量的 DEX 服务器。"},
137137
"Change App Password": {T: "更改应用程序密码"},
138-
"Build ID": {T: "构建 ID"},
138+
"Build ID": {T: "版本"},
139139
"Connect": {T: "连接"},
140140
"Send": {T: "发送"},
141141
"Deposit": {T: "存款"},

client/webserver/site/src/html/bodybuilder.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<link rel="icon" href="/img/favicon.png?v=AZ4AZX">
1010
<meta name="description" content="Bison Wallet">
1111
<title>{{.Title}}</title>
12-
<link href="/css/style.css?v={{commitHash}}" rel="stylesheet">
12+
<link href="/css/style.css" rel="stylesheet">
1313
</head>
1414
<body {{if .UseDEXBranding}}class="dex-branding"{{end}}>
1515
<div class="popup-notes d-hide" id="popupNotes">
@@ -257,7 +257,7 @@
257257
</div>
258258
</div>
259259

260-
<script src="/js/entry.js?v={{commitHash}}"></script>
260+
<script src="/js/entry.js"></script>
261261
</body>
262262
</html>
263263
{{end}}

0 commit comments

Comments
 (0)