Description
Email notifications for CSV exports for the following supported languages pt_BR, zh_CN, zh_TW fall back to English.
To Reproduce
- Browse to
WP Admin -> Users -> Profile
- Change the profile language to any of the languages above.
- Run a CSV export of transactions, payouts or disputes, making sure you have more than a single pagination to trigger a server export
- Check the language of the email triggered, and the CSV contents. It should be in user language but is provided in US English.
Detailed observations here #10003 (review)
Additional context
- The server uses dash-separated locales e.g. pt-br, zh-cn, zh-TW
- WordPress core at the client side, uses locale in the format pt_BR, zh_CN etc.
- We have a utility function
convert_to_server_locale()
that roughly converts the WordPress core locale type to the server supported dash-separated locales. - The CSV export POST request params incorrectly include the locale
en_US
. This is likely a bug that occurs when the request query params are prepared in convert_to_server_locale(). - The issue was found while creating the PR - CSV Exports: Simplify localization by setting export language to that in user profile settings #10003
Activity