Skip to content

Commit

Permalink
fix default language in initLocalizer
Browse files Browse the repository at this point in the history
Co-Authored-By: Alireza Ahmadi <[email protected]>
  • Loading branch information
MHSanaei and alireza0 committed Jun 16, 2023
1 parent 1328bb5 commit 97925ee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions web/assets/js/langs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const supportLangs = [
},
{
name: 'فارسی',
value: 'fa_IR',
value: 'fa-IR',
icon: '🇮🇷',
},
{
Expand All @@ -16,7 +16,7 @@ const supportLangs = [
},
{
name: 'Русский',
value: 'ru_RU',
value: 'ru-RU',
icon: '🇷🇺',
},
];
Expand Down
2 changes: 1 addition & 1 deletion web/html/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ <h1 class="title">{{ i18n "pages.login.title" }}</h1>
<a-row justify="center" class="centered">
<a-col :span="12">
<a-select ref="selectLang" v-model="lang" @change="setLang(lang)" :dropdown-class-name="themeSwitcher.darkCardClass">
<a-select-option :value="l.value" label="English" v-for="l in supportLangs">
<a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs">
<span role="img" aria-label="l.name" v-text="l.icon"></span>
&nbsp;&nbsp;<span v-text="l.name"></span>
</a-select-option>
Expand Down
2 changes: 1 addition & 1 deletion web/locale/locale.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type SettingService interface {

func InitLocalizer(i18nFS embed.FS, settingService SettingService) error {
// set default bundle to english
i18nBundle = i18n.NewBundle(language.English)
i18nBundle = i18n.NewBundle(language.MustParse("en-US"))
i18nBundle.RegisterUnmarshalFunc("toml", toml.Unmarshal)

// parse files
Expand Down

0 comments on commit 97925ee

Please sign in to comment.