-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finish localising the DateEntry and Calendar #5571
base: develop
Are you sure you want to change the base?
Conversation
Just coded in for now
Thanks for adding the Sunday starts - but I don't think they all use US date format ... |
I have them using the day/month/year format? |
So you do - I can't read sorry. |
localeWeekStartKey = "locale.date.startweek" | ||
) | ||
|
||
var localeSettings = map[string]map[string]string{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a very memory inefficient data structure with quite a lot of duplicated data. Is there any way we can make this more efficient as languages grow?
One idea I have is to just use trucks and avoid the map inside map. It might also make sense to have the starting day as an index (maya be as an enum) and not a string to avoid duplicating that data a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was included to be a replacement for the lan file lookups until a better solution was decided upon - you can see the suggestion from @dweymouth.
Yes there are many more efficient ways to pack this data in, but they would not work if we ever make this more configurable again through something like weblate. Optimising for storage in code seems premature with that in mind. Similarly using "0" to represent Sunday (or Monday) makes it hard to read if we move to such a file later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you wish to add Swedish to the list then it is Monday and time.DateOnly
that is correct.
Thanks for this - but given that Swedish is the language do you mean Sweden? (i.e. (SE)?
I have significantly reduced the memory requirement, hopefully this makes it good for now? |
Fixes #5141
Checklist: