Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Translate: a translation into a language the page already has replaces and renames that translation; unknown codes are stored

オープン
#612 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

@guidol-ive がすでに取り組んでいます。

2026年10月28日 から。

  • #613 @guidol-ive による — オープン

評価

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

調査の方向性

Start with textpage::translateAction() in system/datatypes/text.php:220 and Language::getIsoList(); the issue identifies the existing invalid-language message and asks for a new translation-exists message. Check how translations are stored and how the form is shown again after validation fails. Done means unknown language codes and languages already present on the page are rejected, with the form shown again; linked pull request #613 already contains a proposed implementation.

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

説明

Impact: Medium Level: Easy Pagetype: Text Type: Bug Value: Users Value: Visitors

The translate view of a text page offers every language except the current one, also languages in which the page already has a translation, and textpage::translateAction() saves into whatever language is posted (system/datatypes/text.php:220 has // TODO: validate that the language is a valid one).

  1. Translating into an existing language replaces that translation. hypha_setPage() finds the language, renames it to the new name, and storeWikiContent() stores the new text as its latest version. The old address of that translation gives 404, so inbound links and search results break, and the translator gets "page successfully updated" without a warning. (The old text is still in the version list.)
  2. An unknown language code is stored. A posted textLanguage=qq creates <language id="qq"> in hypha.xml. HyphaRequest only accepts codes of languages.json, so the translation can never be opened, and qq then appears in the language list of every page and in the language selector (Language::getLanguageOptionList() reads $isoLangList['qq'], which does not exist).

Steps to reproduce (fictional site, PHP 8.2 container of docs/container; nl/Over_ons has the English translation en/About_us):

  1. Log in, open nl/Over_ons/translate, choose en, name About_the_editors, any text, save.
  2. en/About_us now gives 404; en/About_the_editors has the new text.
$ curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8172/en/About_us
404

#129 mentions the dropdown ("maybe the server-side handling code will even allow them ... I haven't checked"); this issue is about the server side.

Suggested fix. In translateAction(), refuse a language that is not in Language::getIsoList() (message invalid-language, which exists) and a language the page already has (new message translation-exists), and show the form again. Leaving the existing translations out of the dropdown, or showing them separately, is part of #129. The linked pull request does the server side.

Found while checking multilingual sites. Tested in the PHP 8.2 and 8.5 containers of docs/container with a fictional test site: reproduces on main (d97ab7b), gone with the linked pull request, which is offered as a suggestion and a starting point.

🤖 Generated with Claude Code

主要言語
JavaScript
スター
5
フォーク
9
平均マージ
18時間 7分
マージ済み PR(30日)
11

環境構築

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

はじめの一歩

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

PlanBCode/hypha のほかの issue

PlanBCode/hypha の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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