Page MenuHomePhabricator

Page banner of Wikivoyage can not automatically convert the problem of tranditional or simplified Chinese
Closed, ResolvedPublic

Description

As shown below:

2019-03-03_13-15-31.png (444×725 px, 258 KB)

When the mouse move to the ICON position, the text is not automatically converted to Traditional Chinese at this time (users use it in the Traditional Chinese interface)

We tried to modify it in Template:Pagebanner and MediaWiki:Common.js, but it was not successful enough to automatically convert it into Traditional or Simplified Chinese.

For the part of Banner, our Chinese wikivoyage has been modify one after another. At present, only the part of ICON has not been modify successful. can help Chinese Wikivoyage?

Problem code(Template:Pagebanner):

| {{#if: {{{unesco|}}} | icon-unesco=联合国教科文组织世界遗产名录 }}
| {{#if: {{{star|}}} | icon-star=明星条目 }}
| {{#if: {{{otbp|}}} | icon-otbp=昔日曲径通幽 }}
| {{#if: {{{dotm|}}} | icon-dotm=昔日每月目的地 }}
| {{#if: {{{ftt|}}} | icon-ftt=昔日特色旅行话题 }}

Simplified Chinese and Traditional Chinese:
联合国教科文组织世界遗产名录 <=> 聯合國教科文組織世界遺產名錄
明星条目 <=> 明星條目
昔日曲径通幽 <=> 昔日曲徑通幽
昔日每月目的地 <=> 昔日每月目的地
昔日特色旅行话题 <=> 昔日特色旅行話題

Test source website:
九寨沟 - https://zh.wikivoyage.org/wiki/九寨沟
哈尔滨 - https://zh.wikivoyage.org/wiki/哈尔滨
高雄 - https://zh.wikivoyage.org/wiki/高雄
護照 - https://zh.wikivoyage.org/wiki/护照

thanks

Event Timeline

Aklapper renamed this task from The ICON position in banner of Chinese Wikivoyage, does not automatically convert to traditional or simplified Chinese text. to Tooltip text of custom icon on banner on Chinese Wikivoyage is not automatically converted to traditional or simplified Chinese.Mar 3 2019, 9:05 AM
Aklapper renamed this task from Tooltip text of custom icon on banner on Chinese Wikivoyage is not automatically converted to traditional or simplified Chinese to Tooltip text of custom Unesco icon on banner on Chinese Wikivoyage is not automatically converted to traditional or simplified Chinese.

Hi, to see the problem, I need to click the 不转换 dropdown next to 页面 and 讨论, and change the value from 不转换 to 繁體 (traditional; zh-hant), and after the page reloads, I move the mouse over the Unesco icon, and the tooltip shows 联合国教科文组织世界遗产名录 but it should show 聯合國教科文組織世界遺產名錄 , correct?

https://zh.wikivoyage.org/w/index.php?title=Template:Pagebanner&action=edit shows | {{#if: {{{unesco|}}} | icon-unesco={{lan|zh-hans=联合国教科文组织世界遗产名录|zh-hant=聯合國教科文組織世界遺產名錄}} }}.

Where exactly to see code that works as expected? Asking as you wrote "only the part of ICON has not been modify successful"

@Aklapper

  1. Please visit https://zh.wikivoyage.org/w/index.php?title=Template:Pagebanner/testcases&variant=zh-hant&oldid=122016 (variant=zh-hant).
  2. Move the mouse over the Star icon.
  3. The tooltip shows 明星条目. The expected result should be 明星條目.

There are two links to 明星条目 in same page. One is written in zh-hans, another is zh-hant. But their tooltips both are 明星條目. We want the links in the Pagebanner work like this.

This page transclude Template:Pagebanner/sandbox (Difference with Template:Pagebanner). Template:Lan can detect user language to show different text. Use the Template:Lan is a workaround. But I think this should be fixed in the extension.

Jdlrobson subscribed.

This looks like a problem in a template to me as WikidataPageBanner doesn't know anything about Unesco icons.
https://zh.wikivoyage.org/w/index.php?title=Template:Pagebanner&action=edit

I'm guessing the HTML of a banner is going to be cached. I don't know how Template:lan works to know why this is not working but whatever value you give it.
It might be better to use a JavaScript solution in MediaWiki:Common.js or gadget for translating the tooltip if this is not working in the meantime.

| {{#if: {{{unesco|}}} | icon-unesco={{lan|zh-hans=联合国教科文组织世界遗产名录|zh-hant=聯合國教科文組織世界遺產名錄}} }}

@Jdlrobson Template:lan It can only be converted in this fixed text, but if it is a non-fixed text, it may not work.

By the way, we also found that sub-page cannot be converted. In order to simplify the sub-page name, users use "pgname" or "caption" of pagebanner, it is can find the problem that can not be automatically converted.

This problem is the bellow Task:
https://phabricator.wikimedia.org/T217555

I personally don't know much, and I also use Template:lan, but it is also invalid.

Yuriy_kosygin renamed this task from Tooltip text of custom Unesco icon on banner on Chinese Wikivoyage is not automatically converted to traditional or simplified Chinese to Page banner of Wikivoyage can not automatically convert the problem of tranditional or simplified Chinese.Mar 13 2019, 3:29 PM

Dear language team, I'm not sure how Chinese Wikivoyage is setup, and the associated templates "lan" but do templates respect the current language when they go through the parser?

These parameters to the banner code, are defined as properties on ParserOutput
https://github.com/wikimedia/mediawiki-extensions-WikidataPageBanner/blob/master/includes/WikidataPageBanner.hooks.php#L296
Do the different Chinese languages share a ParserOutput? If not, is there a more appropriate way to set/read these values and make this work?

@Jdlrobson It seems your question is about language converter, about which we in the Language team do not know much about nor maintain. If there is any custom caching besides parser cache, it is likely that anything that relies on {{int:}} (In this case module:lan through template:lan) will not work properly because the cache is not split by the user language (and here I assume that requesting a different variant appears as a different user language to the parser – it might be more complicated than that).

Thanks for the clue @Nikerabbit i really appreciate it!

Simplified Chinese or Traditional Chinese appears on Pagebanner... In fact, it should not appear Simplified Chinese and Traditional Chinese. It depends on which Chinese version the user uses, one of Simplified Chinese or Traditional Chinese appears.

Problem-
https://zh.wikivoyage.org/wiki/User:Yuriy_kosygin/工程品實驗室

The correct one should be-
伊戈爾的工程品實驗室、伊戈爾的工程品實驗室
or
伊戈尔的工程品实验室、伊戈尔的工程品实验室

Is this possible to allow the user to automatically convert it with the '''content language variant''' set by the user?

Change 510938 had a related patch set uploaded (by Zhuyifei1999; owner: Zhuyifei1999):
[mediawiki/extensions/WikidataPageBanner@master] Language convert all input 'magic word' parameters

https://gerrit.wikimedia.org/r/510938

Change 510938 merged by jenkins-bot:
[mediawiki/extensions/WikidataPageBanner@master] Language convert all input 'magic word' parameters

https://gerrit.wikimedia.org/r/510938

Let's see if it works correctly next week when it's deployed. (I only tested in vagrant)

Although my own programming language skills are not very good, I am willing to help monitor whether there are normal or abnormal situations in Chinese Wikivoyage!

You can try testing this out on https://en.wikivoyage.beta.wmflabs.org/?uselang=zh !

It's a test wiki so feel free to create any test content that is useful!

You can try testing this out on https://en.wikivoyage.beta.wmflabs.org/?uselang=zh !

Unfortunately, the target language of the parser is the page content language, English, instead of the interface language, Chinese. There's no way to test language converter if the target language is not a $languagesWithVariants.

Though, I would love if you could change a few pages to have zh as content language with Special:PageLanguage.

Hey @zhuyifei1999 we should see what we need to do to get a Chinese Wikivoyage up on the beta cluster today: https://zh.wikivoyage.beta.wmflabs.org/
I was hoping we could use Special:Preferences to change the interface language.

bd808 just gave me steward rights and still https://en.wikivoyage.beta.wmflabs.org/wiki/Special:PageLanguage doesn't exist. I guess it's configuration-disabled rather than lack of permissions. So yeah, let's create that wiki.

Thanks for checking! Shall we resolve or do we want to wait until this hits production?

Please reopen if the problem still exists :) Thanks for taking care of this!

@zhuyifei1999 and @Jdlrobson, thank your fixed, we will look forward to the official release in Chinese Wikivoyage!

@zhuyifei1999 and @Jdlrobson, By the way, What time to the official release in Chinese Wikivoyage? Because I didn’t see the result of the change...