Default error pages get the session's lang on English text

オープン 初心者向け
#1,924 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
html, java
領域
accessibility

調査の方向性

4 つのページは markup.html pages パッケージにあり (PageExpiredErrorPage, AccessDeniedPage, InternalErrorPage, ExceptionErrorPage)、すべて WebPage を拡張しています。まず WebPage#onHtmlTag を読んで、マークアップの lang がセッションロケールより優先され dir を抑制することを確認してから、各ページの <html> タグに lang="en" を追加し、HTML 4.01 Transitional doctype を <!DOCTYPE html> に置き換えてください。完了とは、セッションロケールが nl-NL または RTL であっても、各ページが lang="en" 付きで dir なしの英語テキストをレンダリングすることです。レンダリングされたタグがどのように assert されるかは、既存のページマークアップテストを確認してください。

索引モデルが issue の本文から書いたものです。

説明

Since #1870, every WebPage gets lang and dir on its <html> tag from the page locale. Wicket's default error pages extend WebPage, but their text is hard-coded English and they have no resource bundles:

  • PageExpiredErrorPage
  • AccessDeniedPage
  • InternalErrorPage
  • ExceptionErrorPage

A user whose session locale is nl-NL now gets <html lang="nl-NL" dir="ltr"> on a page that reads "Page Expired". Before #1870, lang was missing. Now it is wrong: screen readers read the English text with Dutch pronunciation, which fails WCAG 2.2 SC 3.1.1 (Language of Page, level A). A user with an RTL locale also gets dir="rtl" on English text.

The pages also still use the HTML 4.01 Transitional doctype.

Possible fix: put lang="en" on the <html> tag of these four pages. A markup lang takes precedence in WebPage#onHtmlTag and also suppresses dir. Replace the doctype with <!DOCTYPE html> at the same time. Translating the pages through resource bundles and dropping the markup lang would be the alternative, but contributed translations for them don't exist yet.

The accessibility chapter of the user guide (#1847) recommends replacing these pages with application pages and mentions this behaviour.

主要言語
Java
スター
800
フォーク
423
平均マージ
1日 1時間
マージ済み PR(30日)
170

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/wicket のほかの issue

apache/wicket の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。