Closed swissspidy closed 6 years ago
The disadvantage is that this only works for WordPress 4.7+ and that — given there are string changes in core — the upgrader messages might differ depending on the WP version.
How should we support earlier WordPress versions?
For earlier WordPress versions we could a) still manually copy the strings or b) leave as is, i.e. strings won't be in English depending on the site language.
@danielbachhuber @swissspidy Please see changelog here - this is introduced in WordPress 3.7.0.
@wojsmol The changelog is not a problem. We're only concerned about WordPress 4.0 anyway. The problem is possible string changes between releases and how we support these.
we could a) still manually copy the strings or b) leave as is, i.e. strings won't be in English depending on the site language.
Ok. I'm fine with option B (degraded performance).
Instead of manually copying all possible strings to the upgrader class I opted to use
switch_to_locale()
.The advantage of using
switch_to_locale()
is that we're always using the correct strings from WordPress core, even if they change between releases.The disadvantage is that this only works for WordPress 4.7+ and that — given there are string changes in core — the upgrader messages might differ depending on the WP version.
Fixes #52.