#5927 closed defect (bug) (fixed)
GlotPress is giving a warning when saving a record with unknown placeholder
Reported by: | psmits1567 | Owned by: | dd32 |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Translate Site & Plugins | Keywords: | |
Cc: |
Description
WooCommerce uses placeholders that are not know by GlotPress
So if you save the record a warning is given, and a polyglots-warning is generated
This is a link to the offending translation
https://translate.wordpress.org/projects/wp-plugins/yith-woocommerce-ajax-navigation/stable/ru/default/?filters[warnings]=yes&sort[by]=translation_date_added
Attachments (1)
Change History (8)
#1
@
3 years ago
- Type changed from enhancement to defect
In order to spell it out for those who can't/won't see the attached image:
A printf() string like the following:
Data: %1$.2fMB | Index: %2$.2fMB | Free: %3$.2fMB | Engine: %4$s
Raises the warning:
Warning: The translation contains the following unexpected placeholders: %1$., %2$., %3$.
#2
@
3 years ago
I've seen this message fly by in the warnings channel a few times, but I hadn't had a chance to look into adding full printf-syntax support.
I'm thinking one way around this is to leave the placeholder check as-is, but to also then do a if unknown placeholder exists at all within original, skip
check.
#3
@
3 years ago
if unknown placeholder exists at all within original, skip check.
Yes, that's probably better than getting stuck in ever more complicated regex expressions.
#4
@
3 years ago
I think that would be the best solution for the future. Unless the placeholder brakes functionality. Then it should still give a warning, but only if it is wrong formatted.
#5
@
3 years ago
I have resolve this problem in GlotPress with this PR https://github.com/GlotPress/GlotPress-WP/pull/1271
Tomorrow I will review it with @dd32, and we will update it at https://translate.wordpress.org
Image showing the problem