Page MenuHomePhabricator

ConfirmEdit hCaptcha: Set `hl` parameter to an acceptable fallback when hCaptcha does not natively support the language
Open, Needs TriagePublic

Description

Summary

hCaptcha currently supports several languages, but not all languages supported by WMF wikis. We should use a fallback instead of English if we are able to.

Background

  • hCaptcha supports many languages, but not as many as are supported by WMF wikis
  • If a user sees the CAPTCHA while using an unsupported language, we need to define an appropriate fallback language
    • The appropriate fallback language will be the first language from LanguageFallback::getAll that is supported by hCaptcha

Acceptance criteria

  • The display language for hCaptcha is forced to a fallback language if hCaptcha does not support the language being used by the user

Event Timeline

If we don't support the hl parameter, that also means that we rely on hCaptcha' detecting the desired locale from the user's browser when displaying the challenge, and that uselang doesn't have any effect. Given that the challenge is intended to be shown to 0.1% of real users, I think this is OK, but we could consider taking on the work to map usage of uselang to values that hl will understand.