Skip to content
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

Improve/fix registration status icon text #10527

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

kr-matthews
Copy link
Contributor

This competition is in just over a month. Previously it also said "in 1 month".

image

This competition is tomorrow. Previously it would have said "in 2 hours".

image

Unfortunately Luxon doesn't seem to be using the locale, so that will need to be fixed if possible (in another PR). Also, other languages have the extra "in" too, it seems (and missing periods).

image

@kr-matthews kr-matthews self-assigned this Jan 4, 2025
@kr-matthews
Copy link
Contributor Author

Actually these strings are also used in the 'all competitions' page (both the old and new UI), so this PR just shifts the extra 'in' problem. However, that page is correctly translating the 'days' message. So we probably want a consistent approach between the two - using luxon in both (with correct locale), or explicitly calculating the number of days and directly translating that (note this never would show "1 month", it's always days). For the former approach, I'm not sure how to make those changes in ruby, so someone else would have to pick this up.

@kr-matthews kr-matthews marked this pull request as draft January 4, 2025 06:09
Copy link
Member

@gregorbg gregorbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments about locale handling

@gregorbg
Copy link
Member

gregorbg commented Jan 4, 2025

About the handling of in: This is a "devil or the deep blue sea" scenario. Luxon does have luxonDt.diffNow().toHuman() method, which (with a little bit of fiddling in terms of passing in the correct config options) would boil down to 3 days, 8 hours without the "in".

However, for most languages there's a notable difference because of grammar. In German for example, if you just enumerate the time units in a "raw" fashion, it's 6 Monate, 3 Tage (six months and three days). In case of a relative time difference, as in "the event happens in 6 months and 3 days" you'd have to change the noun declension to in 6 Monate**n** und 3 Tage**n**.

So I personally feel like it's best to let the Luxon library handle the "in" and "ago" and nasty declensions, and remove them from our translatable I18n keys like you did here.

since the old entries are used (correctly) elsewhere
@kr-matthews
Copy link
Contributor Author

Another PR fixed the wrong locale issue.
I've updated this PR to take that into account. And instead of 'fixing' the existing strings, I've created new ones. Because the existing strings are also used elsewhere, and there the "in" is required. Alternatively, we could update those instances to handle "in" differently and not introduce any new strings.

@kr-matthews kr-matthews marked this pull request as ready for review January 20, 2025 03:27
@gregorbg
Copy link
Member

Alternatively, we could update those instances to handle "in" differently and not introduce any new strings.

I would prefer that, if it's not too much to ask. When you get started and you realize you're wasting more than say ~45 minutes and you have to dig into the source code of some old. deprecated Ruby library, then stop what you're doing, post another comment here and I'll approve the additional transations 😉

@kr-matthews
Copy link
Contributor Author

Alternatively, we could update those instances to handle "in" differently and not introduce any new strings.

I would prefer that, if it's not too much to ask. When you get started and you realize you're wasting more than say ~45 minutes and you have to dig into the source code of some old. deprecated Ruby library, then stop what you're doing, post another comment here and I'll approve the additional transations 😉

The only ruby use is in the old competitions overview code. We recently switched over to the new react version. Can we just remove that old code now? I'm under the impression we won't be switching back to it again.

@gregorbg
Copy link
Member

Your wish be my command! #10674

@kr-matthews
Copy link
Contributor Author

I reverted to the existing strings and updated them. The old competitions overview ruby code will be wrong, but it doesn't matter since it's being removed and can't be seen in the meantime anyway.

I also adjusted it so that for registration open it is precise (since it's a date time), but for competition start the precision is at most days (since it's a date, not a date time).

wst-c
wst-b
wst-1
wst-a
wst-A
wst-B
wst-C
wst-D
wst-3
wst-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants