1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-23 01:20:11 +00:00

fix incomplete lang patching, add en-gb stub

en-gb is empty, so it's patched with en-us strings. Added so DD/MM/YY
date formatting was possible in the ui.
This commit is contained in:
Harvey Tindall 2021-04-07 17:42:15 +01:00
parent 871bc9f396
commit 374ffbf01f
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2
7 changed files with 45 additions and 1 deletions

14
cl.md Normal file
View File

@ -0,0 +1,14 @@
This one isn't super big but includes some pretty important bug fixes.
Features:
* Link-only password resets: Instead of the user having to enter a code, a magic link is sent which will reset the password once clicked. The password reset PIN input sometimes seems broken on Jellyfin (at least for me) so this is kind of a workaround.
* Proper time handling in the web UI: Times displayed on the invites & accounts tab now match the language you're using (e.g MM/DD/YY for en-US and DD/MM/YY for everywhere else). 12/24 hour time can also be toggled in the language menu in the top left.
Fixes:
* Fix missing "Last Active" time on newer versions of Jellyfin (#69)
* Time parser was rewritten so it should handle a lot more formats automatically now.
* Fix bug where user expiry would change/disappear after a restart (#77)
* Add missing attributes that weren't being stored in profiles (#76)
Other:
* Massively cleaned up build files

5
lang/admin/en-gb.json Normal file
View File

@ -0,0 +1,5 @@
{
"meta": {
"name": "English (GB)"
}
}

5
lang/common/en-gb.json Normal file
View File

@ -0,0 +1,5 @@
{
"meta": {
"name": "English (GB)"
}
}

5
lang/email/en-gb.json Normal file
View File

@ -0,0 +1,5 @@
{
"meta": {
"name": "English (GB)"
}
}

5
lang/form/en-gb.json Normal file
View File

@ -0,0 +1,5 @@
{
"meta": {
"name": "English (GB)"
}
}

5
lang/setup/en-gb.json Normal file
View File

@ -0,0 +1,5 @@
{
"meta": {
"name": "English (GB)"
}
}

View File

@ -144,11 +144,14 @@ func patchLang(english, other *langSection) {
} }
func patchQuantityStrings(english, other *map[string]quantityString) { func patchQuantityStrings(english, other *map[string]quantityString) {
if *other == nil {
*other = map[string]quantityString{}
}
for n, ev := range *english { for n, ev := range *english {
qs, ok := (*other)[n] qs, ok := (*other)[n]
if !ok { if !ok {
(*other)[n] = ev (*other)[n] = ev
return continue
} else if qs.Singular == "" { } else if qs.Singular == "" {
qs.Singular = ev.Singular qs.Singular = ev.Singular
} else if (*other)[n].Plural == "" { } else if (*other)[n].Plural == "" {
@ -429,6 +432,8 @@ func (st *Storage) loadLangEmail(filesystems ...fs.FS) error {
patchLang(&english.UserDeleted, &lang.UserDeleted) patchLang(&english.UserDeleted, &lang.UserDeleted)
patchLang(&english.InviteEmail, &lang.InviteEmail) patchLang(&english.InviteEmail, &lang.InviteEmail)
patchLang(&english.WelcomeEmail, &lang.WelcomeEmail) patchLang(&english.WelcomeEmail, &lang.WelcomeEmail)
patchLang(&english.EmailConfirmation, &lang.EmailConfirmation)
patchLang(&english.UserExpired, &lang.UserExpired)
} }
st.lang.Email[index] = lang st.lang.Email[index] = lang
return nil return nil