Skip to content

Commit

Permalink
Merge pull request #1 from sg00dwin/console-2535-jhadvig
Browse files Browse the repository at this point in the history
Adding locales/en.json key value translation file
  • Loading branch information
jhadvig authored Mar 30, 2021
2 parents c08a67d + a1eda4e commit de8cfa7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
7 changes: 6 additions & 1 deletion pkg/server/login/locales.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ var supportedLangs = []language.Tag{
}

var locale_en = map[string]string{
"": "",
"LogInToYourAccount": "Log in to your account",
"Username": "Username",
"Password": "Password",
"LogIn": "Log in",
"WelcomeTo": "Welcome to",
"LogInWith": "Log in with",
}

var locale_zh = map[string]string{
Expand Down
10 changes: 5 additions & 5 deletions pkg/server/login/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ select.pf-c-form-control.pf-m-success { --pf-c-form-control--PaddingRight: var(-
</header>
<main class="pf-c-login__main">
<header class="pf-c-login__main-header">
<h1 class="pf-c-title pf-m-3xl">Log in to your account</h1>
<h1 class="pf-c-title pf-m-3xl">{{ .Locale.LogInToYourAccount }}</h1>
</header>
<div class="pf-c-login__main-body">
<form class="pf-c-form" role="form" action="{{ .Action }}" method="POST">
Expand All @@ -264,26 +264,26 @@ select.pf-c-form-control.pf-m-success { --pf-c-form-control--PaddingRight: var(-
</div>
<div class="pf-c-form__group">
<label class="pf-c-form__label" for="inputUsername">
<span class="pf-c-form__label-text">Username</span>
<span class="pf-c-form__label-text">{{ .Locale.Username }}</span>
<span class="pf-c-form__label-required" aria-hidden="true">*</span>
</label>
<input type="text" class="pf-c-form-control" id="inputUsername" placeholder="" tabindex="1" autofocus="autofocus" type="text" name="{{ .Names.Username }}" value="{{ .Values.Username }}">
</div>
<div class="pf-c-form__group">
<label class="pf-c-form__label" for="inputPassword">
<span class="pf-c-form__label-text">Password</span>
<span class="pf-c-form__label-text">{{ .Locale.Password }}</span>
<span class="pf-c-form__label-required" aria-hidden="true">*</span>
</label>
<input type="password" class="pf-c-form-control" id="inputPassword" placeholder="" tabindex="2" type="password" name="{{ .Names.Password }}" value="">
</div>
<div class="pf-c-form__group pf-m-action">
<button class="pf-c-button pf-m-primary pf-m-block" type="submit" tabindex="3">Log in</button>
<button class="pf-c-button pf-m-primary pf-m-block" type="submit" tabindex="3">{{ .Locale.LogIn }}</button>
</div>
</form>
</div>
</main>
<footer class="pf-c-login__footer">
<p>Welcome to OKD.</p>
<p>{{ .Locale.WelcomeTo }} OKD.</p>
</footer>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions pkg/server/selectprovider/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ body { background-color: var(--pf-global--BackgroundColor--dark-100); }
<main class="pf-c-login__main">
<div class="pf-c-login__main-body">
{{ if eq (len .Providers) 1}}
<a class="pf-c-button pf-m-primary pf-m-block" href="{{ (index .Providers 0).URL }}">Log In</a>
<a class="pf-c-button pf-m-primary pf-m-block" href="{{ (index .Providers 0).URL }}">{{ .Locale.LogIn }}</a>
{{ else }}
<h1 class="pf-c-title pf-m-3xl">Log in with&hellip;</h1>
<h1 class="pf-c-title pf-m-3xl">{{ .Locale.LogInWith }}&hellip;</h1>
<ul>
{{ range $provider := .Providers }}
<li class="idp">
Expand Down

0 comments on commit de8cfa7

Please sign in to comment.