Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

gettext: missing ValueErrors on seven function pages

未关闭
#6,001 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
76/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
php, xml
领域
documentation

调研方向

Start with the seven XML pages under reference/gettext/functions/ and the existing dgettext() page for the expected errors-section wording and <simpara> structure. Check ext/gettext/gettext.c and the cited PHP versions to verify each ValueError, false return, and version threshold. Done means every listed page has a complete errors section, bind_textdomain_codeset() documents string|false, and matching changelog rows are added.

由索引模型根据 Issue 内容生成。

描述

bug
Affected page

reference/gettext/functions/dcgettext.xml
reference/gettext/functions/dcngettext.xml
reference/gettext/functions/gettext.xml
reference/gettext/functions/ngettext.xml
reference/gettext/functions/textdomain.xml
reference/gettext/functions/bindtextdomain.xml
reference/gettext/functions/bind-textdomain-codeset.xml

Issue description

These pages have no errors section, or an incomplete one, and no matching changelog row:

  • dcgettext(), dcngettext(): ValueError for an empty or over 1024 byte domain, an over 4096 byte message/singular/plural, and LC_ALL as category (the empty domain and LC_ALL cases as of 8.4.0, the length cases as of 8.0.0).
  • gettext(), ngettext(): ValueError for an over 4096 byte message/singular/plural (8.0.0).
  • textdomain(), bind_textdomain_codeset(): the over 1024 byte domain is missing, and for textdomain() also "0" (8.4.0).
  • bindtextdomain(): empty or over 1024 byte domain; directory "0" or "" means the current directory, and the path must exist or false is returned.
  • bind_textdomain_codeset() returns string|false, the page only says string.
Steps to reproduce
try { dcgettext("", "x", LC_MESSAGES); } catch (Throwable $e) { echo $e->getMessage(); }

Output: dcgettext(): Argument #1 ($domain) must not be empty

Suggested fix

Add the errors section and changelog rows (same wording as the existing dgettext() page), use <simpara>. Sources: ext/gettext/gettext.c (php-8.0.0, php-8.4.0, php-8.5.9).

主要语言
XML
星标
606
派生
906
平均合并
1 天 6 小时
30 天内合并 PR
84

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

php/doc-en 的其他 Issue

查看 php/doc-en 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。