wp-cli / language-command

Installs, activates, and manages language packs.
MIT License
13 stars 22 forks source link

Make sure upgrader strings are always in English #54

Closed swissspidy closed 6 years ago

swissspidy commented 6 years ago

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.

danielbachhuber commented 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?

swissspidy commented 6 years ago

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.

wojsmol commented 6 years ago

@danielbachhuber @swissspidy Please see changelog here - this is introduced in WordPress 3.7.0.

swissspidy commented 6 years ago

@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.

danielbachhuber commented 6 years ago

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).