woocommerce / woocommerce-paypal-payments

https://wordpress.org/plugins/woocommerce-paypal-payments/
GNU General Public License v2.0
62 stars 47 forks source link

Register Payment Title as a translatable string (223) #1370

Open Buzut opened 1 year ago

Buzut commented 1 year ago

The Paypal payment title is user defined. Therefore there isn't PO files that can be used for it.

In order to work with multilingual websites, this field needs to be declared as translatable using the icl_register_string. This function is the de facto standard as WPML as well as Polylang (the two most popular i18n plugins) use it.

Otherwise, in it current form, it stays the same regardless of the frontend language.

diiegopereira commented 6 months ago

Just a quick note: for WPML, it's currently recommended to use the wpml_translate_single_string filter, instead of the icl_register_string function: https://wpml.org/wpml-hook/wpml_translate_single_string/

With the filter there is no risk of errors if WPML is not active and the function does not exist.

InpsydeNiklas commented 3 months ago

Hi @Buzut #2308 introduces a potential workaround for this in the 2.8.1 update. A related discussion can be found https://github.com/woocommerce/woocommerce-paypal-payments/issues/2119 But we will leave this issue open until we can better judge when a proper solution (using native Admin Settings API) could be expected. It will take a few more months at least, though.