Opened 8 years ago
Closed 8 years ago
#1934 closed enhancement (invalid)
Prevent difference in number of placeholders in original text and translation
Reported by: | johnbillion | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Translate Site & Plugins | Keywords: | |
Cc: |
Description
Ref: #WP37807
A translation for the following text in core was provided and approved, but the translation contained two placeholders instead of just one, which results in a PHP error.
Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%1$s">WordPress Plugin Directory</a> or upload a plugin in .zip format by clicking the button at the top of this page.
GlotPress should:
- Detect translations that use a greater number of placeholders than the original string, and prevent the translation from being approved by anyone.
- Detect translations that use a fewer number of placeholders than the original string, and raise a warning to alert the translators in case of an error.
Change History (4)
#2
@
8 years ago
Yes, GlotPress already issues a warning in this case:
*Warning:* Too many tags in translation. Extra %2$s placeholder in translation.
I've found two related entries in #polyglots-warnings:
- Occitan (#oci): https://wordpress.slack.com/archives/polyglots-warnings/p1468076262000840
- Malay (#ms): https://wordpress.slack.com/archives/polyglots-warnings/p1468926450000046
Not sure why there was no warning for Spanish. Maybe because it was a fuzzy string?
#3
@
8 years ago
In that case, this is probably a duplicate of https://glotpress.trac.wordpress.org/ticket/539
#4
@
8 years ago
- Resolution set to invalid
- Status changed from new to closed
Issues with GlotPress should be reported on the GitHub repo.
It looks like fuzzy translations are not checked for warnings, see https://github.com/GlotPress/GlotPress-WP/issues/529.
AFAIK GlotPress already does that. I assume the problem in that case was a change to the original string without an update to the translation.