-
-
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
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. |
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? |
Oh, yes of course. That's what I meant |
if pos := strings.Index(lang, "-"); pos != -1 { | ||
region = strings.Split(lang, "-")[1] | ||
} |
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.
I think this might be cleaner to do using strings.Cut
.
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.
Doesn't that require the second instance of the separator? It is optional in this instance.
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.
I figured it would be possible to do something like this to just use one strings API instead of two to achieve the same result. However, I do see now that the following code assumes that the region is the end of the file so it might be moot.
_, trailing, found := strings.Cut(lang, "-")
if found {
region = trailing
}
Tests finally passing again |
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.
Looking good 👍
Fixes #5141
Checklist: