Page MenuHomePhabricator

Submit button text displays in wrong language
Closed, DuplicatePublic

Description

The language of the value attribute of the <input type="submit"> elements in <inputbox>s is always set to the language setting that the user who most recently edited the page had while editing, instead of the language of the user currently viewing the page.

Steps to reproduce:

  1. Go to a page with some <inputbox>s, such as https://www.mediawiki.org/wiki/Extension:InputBox
  2. Change language settings to a different language (such as, say, Chinese: https://www.mediawiki.org/wiki/Extension:InputBox?setlang=zh )
  3. Go to the edit page ( https://www.mediawiki.org/wiki/Extension:InputBox?action=edit ) and click "Save page" or equivalent.
  4. Set language back to original language (assuming English: https://www.mediawiki.org/wiki/Extension:InputBox?setlang=en ). The content of the input elements remain in the other language.

Version: unspecified
Severity: major

Details

Reference
bz59693

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:20 AM
bzimport set Reference to bz59693.
bzimport added a subscriber: Unknown Object (MLST).

In the InputBox class I see:

Split caches by language, to make sure visitors do not see a cached
version in a random language (since labels are in the user language)
$this->mParser->getOptions()->getUserLangObj();

Which was added in I69ade88bb43f73404965b7cb63e88b824561d988 by Hoo (cc'd).

This has probably the same cause as bug 60715

I am not able to replicate this. Could be because I am not following the steps correctly? Can someone please confirm this issue.

Can't replicate too.

  1. Going to Extension:InputBox the input boxes are shown in English (which is my preference).
  2. Went to Special:Preferences, set Swedish as my language.
  3. Going to Extension:InputBox the input boxes now have swedish text.
  4. Went to Special:Preferences, set Chinese as my language.
  5. Going to Extension:InputBox the input boxes now have chinese text.
  6. Went to Special:Preferences, set English as my language again.
  7. Going to Extension:InputBox the input boxes are shown in English again.

As this was opened more than 3 years and two people weren't able to reproduce this as of now, I'd tend to close this bug.

As this was opened more than 3 years and two people weren't able to reproduce this as of now, I'd tend to close this bug.

I'd give it some time :)

Also, I think you missed a step:

  1. Go to the edit page ( https://www.mediawiki.org/wiki/Extension:InputBox?action=edit ) and click "Save page" or equivalent.

I'd give it some time :)

That's why I didn't just close it ;)

Also, I think you missed a step:

  1. Go to the edit page ( https://www.mediawiki.org/wiki/Extension:InputBox?action=edit ) and click "Save page" or equivalent.

I don't think that is really needed. The important statement here is:

The language of the value attribute of the <input type="submit"> elements in <inputbox>s is always set to the language setting that the user who most recently edited the page had while editing, instead of the language of the user currently viewing the page.

This would mean that I should see the same language all the time, regardless if my personal language preference is set to English, Swedish, Chinese or somthing else. In all of those cases I should see the input box in the same language (the one the last editor had in their preferences) if the above were true, but that isn't the case. The languages in input boxes change accordingly. I'm not saying that the page always gives output in the viewers language. To me it seems that this is the case, but of course I can't say if that's generally and always true. But I can say that it behaves correctly (showing viewers preffered language) for me, so I can make the point that it is wrong that the input language is always the one the last editor had in their preferences.

Yep. That makes sense! Software and caching sometimes works is mysterious ways, so I just wanted to be sure :)

I think I can replicate this now. This is what I've tried so far:

  1. Go to Extension:InputBox. Things are in English.
  2. Go to Special:Preferences, set language to German.
  3. Go to Extension:InputBox. Things are in German.
  4. Click "Edit page" link and do a zero-edit, by not changing anything but just clicking "Save page".
  5. Things are in German.
  6. Go to Special:Preferences, set language to English.
  7. Go to Extension:InputBox. Things are in German.
  8. Do a hard reload, forcing your browser not to load anything from it's own cache. Things are still in German.
  9. Open up an other browser which you don't regularly use, which hence has no cookies set for mediawiki.org and isn't logged in anywhere. Go to Extension:InputBox in that browser. Things are in English.
  10. Switch back to the browser which you used to edit the page and in which you are logged in. Confirm everything is still in German, even after hard-reloading again.
  11. Log out. On "You were logged out." page, click "Return to Extension:InputBox". Notice things are in English now.
  12. Log back in. The login page will take you back to Extension:InputBox and you will see things in German again.
  13. Log out. On "You were logged out." page, click "Return to Extension:InputBox". Notice things are in English now.
  14. Clear all browser cookies.
  15. Log back in. The login page will take you back to Extension:InputBox and you will still see things in German.
  16. Click "Edit page" link and do a zero-edit, by not changing anything but just clicking "Save page".
  17. Things are in English again.

This is a dupe of T194815 (but with more exact repro description)