Translate: a translation into a language the page already has replaces and renames that translation; unknown codes are stored
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 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 の本文から書いたものです。
説明
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).
- Translating into an existing language replaces that translation.
hypha_setPage()finds the language, renames it to the new name, andstoreWikiContent()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.) - An unknown language code is stored. A posted
textLanguage=qqcreates<language id="qq">inhypha.xml.HyphaRequestonly accepts codes oflanguages.json, so the translation can never be opened, andqqthen 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):
- Log in, open
nl/Over_ons/translate, chooseen, nameAbout_the_editors, any text, save. en/About_usnow gives 404;en/About_the_editorshas 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PlanBCode/hypha のほかの issue
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
Impact: Medium Level: Easy Type: Bug Value: Users
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
Impact: Low Level: Easy Type: Bug Value: Coders
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
PlanBCode/hypha#586 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
PlanBCode/hypha の issue をすべて見る
似ている issue
-
FEATURE REQUEST
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
linuxmint/cinnamon-spices-extensions#1193 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Fei2411/DeepSeek-Bot#703 ·
-
area:web first-timers-only good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
career-ops-hq/career-ops#6264 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
cline/mcp-marketplace#3394 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
exelearning/exelearning#2677 ·
メンテナーはふだん 1 日以内に返信