MediaWiki talk:Centralnotice-template-read only banner
Latest comment: 3 years ago by Trizek (WMF) in topic La structure assemblée
Hardcoded date format
edit@Trizek (WMF): Unfortunately this doesn’t work for all languages. Most (if not all) indo-european languages use the day/month format, but non-indo-europeans like Chinese or Hungarian (and even US English) use month/day, and even indo-european ones use different formats, e.g. in German one should write 1. September (with a period), in French 1er septembre, and so on. —Tacsipacsi (talk) 13:49, 1 September 2020 (UTC)
- @Tacsipacsi, what is your suggestion then? Have 2020-09-01 being opened to translations, use {{date}}, or something else? I'm all ears about improvements there! :) Trizek (WMF) (talk) 14:45, 1 September 2020 (UTC)
- @Trizek (WMF): Sorry for not being very detailed above; I tried to get the edit saved ASAP (and certainly before the database lock). As you provided no edit summary, I can only guess why you introduced raw
#time
in the first place—probably because you wanted to skip the year? I see two directions here:- Use some template like {{date}}. This introduces instant translation to many languages, but it’s up to 99% localized by design, never 100%—things like dashes cannot be translated.
- Translate the whole string in once. This allows perfect localization, but needs to be retranslated each time the date/time changes.
- A mix of the above two: using Extension:Translate it would look like
<translate>{{#time:j F|<tvar|1>2020-09-01</>|en}}, {{#time:H:i|<tvar|2>2020-09-01 14:00</>|en}}–{{#time:H:i|<tvar|3>2020-09-01 15:00</>|en}} UTC
. This gives translators almost complete freedom, while keeping variable data out of translation, but I don’t know if it’s possible in CentralNotice.
- The third one looks the best for me; if that’s impossible, probably the second one is better, but translators should be given enough time (and notification) to get the new dates translated in case of a future read-only time (like the revert of today’s eqiad/codfw switch). —Tacsipacsi (talk) 23:58, 1 September 2020 (UTC)
- @Trizek (WMF): Now there’s still time to fix this i18n issue until the switchback. Please provide a correct date format in as many languages as possible. —Tacsipacsi (talk) 20:26, 20 October 2020 (UTC)
- Tacsipacsi, I kept this conversation in mind while using this banner again. However, they may not work.
- I know templates don't work on CentralNotice banners, for obvious safety reasons. Concerning the other solutions, they all rely on getting translations done for all languages, which is, based on my experience, not guaranteed.
- Concerning the third solution, based on code, I can't afford to have something untested being displayed in a banner for an announcement this big. Like for templates, special codes may not work. Plus there is an high risk of having bad translations being made if you leave raw code on a message. This solution is used for Tech News, but it actually doesn't work for English. We actually remove the code for English when we distribute the message each week.
- We will have other opportunities to reuse this message for other maintenance times. I will work on it when the time comes (even if it is very difficult to do so).
- Trizek (WMF) (talk) 14:13, 21 October 2020 (UTC)
- @Trizek (WMF): After a second thought, what about just dropping the date as a short-term solution, keeping only the time? This banner is displayed on that day anyway. The time localization is probably still needed for some languages, but more languages should be okay with this default format. By the way, if I understand correctly why English dates need to be changed to manual, it’s no longer necessary since the adoption of {{TRANSLATIONLANGUAGE}}; and neither in the code snippet I posted above, since it leaves changing the language code up to the translator. —Tacsipacsi (talk) 21:28, 21 October 2020 (UTC)
- Tacsipacsi, I agree on the fact that we could remove the date, but I'm sure (I'm actually ready to bet) that people will ask us for which date this banner is for. :) And concerning the hour, I don't know how used to are to instantly convert UTC to your local time. I would love to have a way to display the local hour on the banner!
- I'll check on TRANSLATIONLANGUAGE soon, to see if it could work on a banner. Thank you for this suggestion! Trizek (WMF) (talk) 11:32, 22 October 2020 (UTC)
- @Trizek (WMF): Unless this system actually uses Extension:Translate (which I don’t think so), the tvar and TRANSLATIONLANGUAGE syntax won’t work in this exact form, they only work in Tech News. In contrast, adapting to local timezone is pretty easy, since this message can use JavaScript: just wrap the date in some HTML tag (say,
<span class="centralnotice-template-read_only_banner-time">14:00 UTC</span>
), and add the following JS code snippet:—Tacsipacsi (talk) 00:04, 23 October 2020 (UTC)var $time = $( '.centralnotice-template-read_only_banner-time' ); var time = new Date( '1970-01-01T' + $time.text().replace( ' UTC', 'Z' ) ); var hours = time.getHours(); var mins = time.getMinutes(); $time.append( ' (' + ( hours < 10 ? '0'+hours : hours ) + ':' ( mins < 10 ? '0'+mins : mins ) + ')' );
- Thank you for taking care of this, Tacsipacsi. We have to try this. As I said, I will definitely try it for the banner after Oct 27 read-only, when I will have some time to make some tests. Trizek (WMF) (talk) 10:20, 23 October 2020 (UTC)
- @Trizek (WMF): I understand that you don’t want to run experiments, but please do something until Tuesday. Either remove the date (sure, if someone wants to misunderstand it, they can, but I think if someone wants to understand it, they will), or use a language-agnostic date format like ISO 8601. It’s just pain to see this attack against the Hungarian language. —Tacsipacsi (talk) 00:26, 24 October 2020 (UTC)
- I want to conduct some experiments Tacsipacsi, but don't have time to run them now.
- At the moment, the following syntax is used:
{{#time:d xg|2020-10-27|{{PAGELANGUAGE}}}}
. I reviewed the documentation and found no solution that would be universally translated (and nicer than 2020-10-27). I use the global settings used by default. I'm sorry if you language is impacted, but changing something would impact more languages. - As said, I will run some experiments when I will have more time to do so. I plan to check on the date, see i it possible to have it properly translated if possible, and also display the local time instead of the UTC one.
- Overall, the question of displaying dates and conducting these tests is not only about this banner. It would benefit to all banners. Wold you start a global discussion about it?
- Thank you! Trizek (WMF) (talk) 08:51, 26 October 2020 (UTC)
- @Trizek (WMF): What global settings? This format is wrong not only in Hungarian, but also in such “small” languages like Spanish, German, Chinese, French or Japanese. Actually I don’t know any language other than (British) English that this format is OK in. Yes, even 2020-10-27 is better—it’s not nice, but at least not actively wrong. —Tacsipacsi (talk) 18:05, 26 October 2020 (UTC)
- French is displayed correctly: "27 octobre". I just saw the banner on my volunteer account. It is also correct for Spanish: "27 octubre". I don't speak the other languages you mention. Trizek (WMF) (talk) 13:48, 27 October 2020 (UTC)
- @Trizek (WMF): Isn’t a “de” missing in both languages? I’m not fluent in these, so I may be wrong. However, I’m absolutely sure that Hungarian should be
F j.
(október 27.) and German should bej. F
, with a period (27. Oktober). I’m also pretty sure that both Chinese and Japanese should ben月j日
(10月27日). Hungarian and German readers will probably understand the current format, but 27 10月 may be simply incomprehensible for a Japanese or Chinese reader. —Tacsipacsi (talk) 19:56, 27 October 2020 (UTC)- @Tacsipacsi: There is no "de" needed for French, and both are fine for Spanish. Anyway, beyond this, this date issue goes beyond this banner. We should have a more global conversation about it. Trizek (WMF) (talk) 11:10, 28 October 2020 (UTC)
- @Trizek (WMF): Isn’t a “de” missing in both languages? I’m not fluent in these, so I may be wrong. However, I’m absolutely sure that Hungarian should be
- French is displayed correctly: "27 octobre". I just saw the banner on my volunteer account. It is also correct for Spanish: "27 octubre". I don't speak the other languages you mention. Trizek (WMF) (talk) 13:48, 27 October 2020 (UTC)
- @Trizek (WMF): What global settings? This format is wrong not only in Hungarian, but also in such “small” languages like Spanish, German, Chinese, French or Japanese. Actually I don’t know any language other than (British) English that this format is OK in. Yes, even 2020-10-27 is better—it’s not nice, but at least not actively wrong. —Tacsipacsi (talk) 18:05, 26 October 2020 (UTC)
- @Trizek (WMF): I understand that you don’t want to run experiments, but please do something until Tuesday. Either remove the date (sure, if someone wants to misunderstand it, they can, but I think if someone wants to understand it, they will), or use a language-agnostic date format like ISO 8601. It’s just pain to see this attack against the Hungarian language. —Tacsipacsi (talk) 00:26, 24 October 2020 (UTC)
- Thank you for taking care of this, Tacsipacsi. We have to try this. As I said, I will definitely try it for the banner after Oct 27 read-only, when I will have some time to make some tests. Trizek (WMF) (talk) 10:20, 23 October 2020 (UTC)
- @Trizek (WMF): Unless this system actually uses Extension:Translate (which I don’t think so), the tvar and TRANSLATIONLANGUAGE syntax won’t work in this exact form, they only work in Tech News. In contrast, adapting to local timezone is pretty easy, since this message can use JavaScript: just wrap the date in some HTML tag (say,
- @Trizek (WMF): Now there’s still time to fix this i18n issue until the switchback. Please provide a correct date format in as many languages as possible. —Tacsipacsi (talk) 20:26, 20 October 2020 (UTC)
- @Trizek (WMF): Sorry for not being very detailed above; I tried to get the edit saved ASAP (and certainly before the database lock). As you provided no edit summary, I can only guess why you introduced raw
La structure assemblée
edit@Trizek (WMF): I don’t think La structure assemblée
is a valid link target here… What did you want to achieve? —Tacsipacsi (talk) 00:43, 19 January 2021 (UTC)
- Wow, thank you for spotting this Tacsipacsi. I think it is a bad copy-pasting. Thank you again. I'm so confused! Trizek (WMF) (talk) 13:11, 19 January 2021 (UTC)