[Function _n] What wrong?
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
调研方向
从提供的 _n() 调用和 Theme Check 翻译警告开始,然后检查 checker 如何计算 _n() 参数并识别文本域。使用 WooCommerce 代码片段重现该警告,并将其与 WordPress 的 _n() 参考进行比较;完成的标准是 checker 只报告实际的文本域,不再将 downloads_remaining 视为文本域。
由索引模型根据 Issue 内容生成。
描述
This code of Woocommerce Plugin:
echo apply_filters( 'woocommerce_available_download_count', '<span class="woocommerce-Count count">' . sprintf( _n( '%s download remaining', '%s downloads remaining', $download['downloads_remaining'], 'domain' ), $download['downloads_remaining'] ) . '</span> ', $download );
but Them check is warning:
WARNING: Found a translation function that has an incorrect number of arguments. Function _n, with the arguments '%s download remaining', '%s downloads remaining', downloads_remaining, 'domain'
I see code here:
https://developer.wordpress.org/reference/functions/_n/
And my text domain is domain:
Warning: More than one text-domain is being used in this theme. This means the theme will not be compatible with WordPress.org language packs.
The domains found are domain, downloads_remaining
I only found downloads_remaining in echo apply_filters( 'woocommerce_available_download_count', '<span class="woocommerce-Count count">' . sprintf( _n( '%s download remaining', '%s downloads remaining', $download['downloads_remaining'], 'domain' ), $download['downloads_remaining'] ) . '</span> ', $download );
What wrong?
- 主要语言
- PHP
- 星标
- 372
- 派生
- 114
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
WordPress/theme-check 的其他 Issue
-
Blocklisted file-extension patterns are unanchored, so ordinary filenames fail the check可能已有人在做 @CookieDarb 于 35 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
WordPress/theme-check#504 ·
-
Bug: "License" and "License URI" are missing from Theme Info summary when checking the active theme可能已有人在做 @CookieDarb 于 130 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
WordPress/theme-check#494 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
WordPress/theme-check#492 · 2 条评论 ·
-
Theme Check flags "wordpress" identifier as REQUIRED — false positive, do not "fix" by renaming可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 45/100
WordPress/theme-check#505 · 1 个 reaction ·
-
Typescript Tests未关闭
难度 5/5 一周以上 新手友好度 25/100
WordPress/theme-check#491 ·
查看 WordPress/theme-check 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 89/100
backdrop-contrib/commerce#65 ·
-
backend enhancement good first issue php
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement good first issue help wanted
难度 2/5 1-3 小时 新手友好度 78/100
Evalogical-Inc/devReady#66 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
mollie/PrestaShop#1627 ·
维护者通常 5 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
FriendsOfFlarum/follow-tags#118 ·