Translate: a translation into a language the page already has replaces and renames that translation; unknown codes are stored
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- php
- Ambito
- backend, internationalization
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- JavaScript
- Stelle
- 5
- Fork
- 9
- Merge medio
- 18h 7m
- PR unite (30g)
- 11
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PlanBCode/hypha
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Impact: Medium Level: Easy Type: Bug Value: Users
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Impact: Low Level: Easy Type: Bug Value: Coders
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
PlanBCode/hypha#586 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PlanBCode/hypha
Issue simili
-
ai-driven-fuzzing bug claude Minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
linagora/cozy-client#1777 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[guide] AGENTS.md claims the coverage gate, e2e and full lint run on every PR after ADR 0011 focused validationForse già presa @hivecommons-hive l’ha presa oggi. Apertaagent/guide documentation hive/claimed-by-guide stage/040-covered-by-pr
Difficoltà 2/5 1-3 ore Idoneità per principianti 81/100
cncf/endusers#2006 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
check:passed feeds:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 4 giorni
-
CMS video element: "CmsVideoPlugin" sets `volume = 0`, so videos cannot be unmuted on Android ChromeApertaneeds-triage Platform(Default)
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
all-contributors/cli#587 ·
I maintainer di solito rispondono entro 1 giorno