-
Notifications
You must be signed in to change notification settings - Fork 444
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
Date formats should allow different configurations for each language #5540
Comments
Yes, each journal/press in a multi-tenant install would need to be able to set their own date formats on a per locale basis to override global defaults. |
I can predict that the next request will be for date formats by user... would it not be a good general solution to just go with that? |
I would be quite happy with a per locale basis, as date format is primarily linked to language used. If you want to offer it on a per user basis, I would (as a user) still have to define/specify a syntax/format tied to the language interfaces I use (if I use more than one language). Another option would be not to offer date formats long or short and apply the international ISO 8601 format : YYYY-MM-DD. But I guess not everyone will like that... |
Thanks, @mhvezina, that's very helpful; I would have expected that the user (that's you!) would not want the formats to change when they used several languages, but rather that they would use the one format of their preference. Can you describe your use case a little more? |
(FWIW I would love ISO8601 to become universal!) |
Hi @asmecher,
I guess expected behavior is the same whether date format is set by admin or user. Let say I have a multi-journal instance, with 3 journals. One (A) uses only French (forms, submission, UI), another one (B) is trilingual (French, English, Spanish) and a last one (C) is only in English. I think, what I would expect, as a user, is to see the date (long format) in a correct (most accepted? https://en.wikipedia.org/wiki/Date_format_by_country) format according to the locale of the UI and hence that is coherent with the rest of the text content displayed : A : “Réponse requise pour le 7 février 2020” B : English UI : “Response required by February 7, 2020” C : “Response required by February 7, 2020” What I don’t want to see :
Conclusion for me: it’s really tied to the locale used by the user (hence Again, adopting ISO 8601 would solve this issue. I wouldn’t be bothered to see a YYYY-MM-DD date, even in the email text… but I can’t talk for users and editors... |
I think there are a couple issues that would arise from this. First, these date formats are used for public-facing information (article landing page) as well as internal info (activity dates in submission lists). Journals typically want to exercise firm control over the public-facing information and consistency is important. If an American reader sees MM/DD/YYYY and a British reader DD/MM/YYYY, there's likely going to be some uncertainty which can result from that if the publisher is British. The source of the information is part of how its recorded. Second, I can see some benefit to offering user-control over internal info, but this would raise some tricky questions. For example, what happens when dates (like review due dates) are put into emails. If we use the sender's date format, the recipient might get some weird format they've never seen before. If we use the recipient's date format, the sender will see in the email preview a date format that looks wrong to them. For these reasons I think it's right to ensure consistent use at a journal level. Journals are the authority responsible for setting consistent publishing and operating standards, and often want control over the experience that people have interacting with their journal. |
Yes...emails.... good point.... well for dates that are to be "shared" between users (like in an email), I would enforce/use ISO8601 format (or maybe allow the display format to be set at the journal level) For web interfaces - internal (OJS dashboard), I would go for the locale user-based choice For web interface - public (article landing page), I would go with, in this order of priority/precedence: (1) the locale set by the OJS user if any (if language toggle is present on the OJS public website), then (2) the locale user's browser. My understanding is that dates should always be stored in a standard format (ISO8601) ; format conversion functions should be use each time a different display format is needed (e.g. web interfaces). |
We do use
I think there's a case to be made for editors and editorial assistants to be have some control over how dates are displayed to them. But I am not sure how many would actually discover the setting and then take the time to customize it. In my experience, most users take the path of least resistance and I would be very surprised if more than 1% of them ever bothered to change the setting.
We can't rely on the locale of the user's browser because the content is delivered from the server side, which doesn't have access to that information. I think our current approach -- the journal's primary locale by default, with the user able to switch languages -- is the right approach. In the vast majority of cases, users are not logged in when viewing the article landing page, so it doesn't seem like there would be much to gain here from allowing users to set their own date formats.
Yes, all of our dates are stored this way. |
Hi @NateWr, Yes, I undersand that ISO8601 date format in correspondence might not be the most appropriate... Regarding "non-shared" dates :
I meant to go with the default date format based on the user locale conventions (the date rendering would then be something to what the JS method toLocaleDateString() does), not add a setting to offer the user to choose a date format in the user profile (which, as you said, no one will bother to set).
No, no gain. Again I meant to go with the date format associated to the locale chosen by the user, if any. If not, fallback on the date format associated to the locale user's browser. So, what it would look like for a localized long date format would be something like that : Format for long (or short) dates could be however set by Journal's editor for each of the chosen languages set by the Journal (e.g. whether "March 11, 2020" or "Wednesday, March 11, 2020"; "11 mars 2020" or "Mercredi 11 mars 2020"). |
Ah, sorry for misunderstanding you! Then I think we're in total agreement here. Each journal needs to be able to set separate date formats for each locale they support. 👍 |
@NateWr, I can't understand why there are 2 pairs of date and date-time formats and time format as a separate setting. Would it be simpler to diminish the number of settings by combining them? I mean, there are 5 settings: |
After thinking about it for a while, my proposal is 3 mandatory fields: long date format, short date format and time format plus 2 optional fields: long and short date & time with 2 values - default, which simply consists of values from long or short date + time and custom field to allow user own input. |
We typically avoid concatenating two localised strings into one, because some languages may wish to change the order. For example, some languages may want I think that we can get to the same easy UX by automatically completing the datetime formats for people. If you are using the So the options can be:
And if the user changes
|
PR to ui-libary master: pkp/ui-library#113 |
Thanks @Vitaliy-1! I gave it a test and it's working well. Looks like the datetime format syncing got pretty complicated. 🔨 I've left some comments on the PRs -- mostly just some text and variable naming adjustments. In addition:
Otherwise it looks good to go, nice work! |
pkp/pkp-lib#5540 Add date format configuration to journal settings
pkp/pkp-lib#5540 Add date format configuration to journal settings
pkp/pkp-lib#5540 Add date format configuration to journal settings
pkp/pkp-lib#5540 Add date format configuration to journal settings
🎉 All merged! Thanks @Vitaliy-1. |
@amandastevens This may effect documentation. In 3.3 it will be possible to configure the date formats for each journal and locale. In previous versions the format could only be set in the config file, and the same format was used for all journals in all locales. This screenshot shows OMP but it's the same in OJS, OMP and OPS. |
@Vitaliy-1, I think something related to this is causing the OMP Travis tests to fail recently. The logs fill with..
Could you take a look? |
@Vitaliy-1, hmm, this must be something related to my repo, as it's not failing on the official master branch. Let me look into it more before bringing you in. |
I've encountered it in my OMP test failures here: https://travis-ci.com/github/pkp/omp/builds/205889218. I'll look into it now unless either of you have already figured it out? |
I think this arises when there are no custom datetime formats defined for a journal, press or preprint server. It should be fixed in 872a4fe. It's being tested now at pkp/omp#890 and will get merged in with that if it passes. |
The commit fixes the PHP notice even though the tests are still failing. Anyway, nothing more related to this issue I think. |
I know this is closed, but just wanted to drop by and say that this was a great new feature that has been requested many times by our journals. Thanks for the work! |
pkp/pkp-lib#5540 Add date format configuration to journal settings
Describe the problem you would like to solve
The date formats are defined in the config file. Different languages may require distinct formats. This makes it challenging to find date formats that are appropriate across all languages. In a multi-tenant setup, where each journal is completely distinct, it may also be challenging to find a format that all tentants agree upon.
Describe the solution you'd like
A couple of options.
It would be nice to support both, so that defaults could be set in the config file and each journal/press manager could override them with their own. This would be particularly important for SaaS or multi-tenant setups.
cc @mfelczak to see if this is something hosting is interested in.
Who is asking for this feature?
An administrator of a multi-lingual journal. See the original request.
The text was updated successfully, but these errors were encountered: