I have put so much time in this now, and my conclusion that your plugin is not multilingual. I really really hope that you can show me that what I am doing is wrong.
Initially I tried translating the CPO options with WPML but they were breaking the formula so I set them to “Do not make ‘CPO option’ translatable”. The translations I provided did not seem to be used anywhere anyway.
The following is what I do now.
Say I have product in English (EN) with a CPO form with a few fields. I have set up a formula and everything is working fine.
Then I use WPML to add a French (FR) translation of the product. In the multilingual setup for the product I set all the _cpo fields to Translate and Apply. I edit the FR translation and make sure to copy all the _cpo field values from EN to FR. I check that in the front end the FR product is showing a correctly working English form.
I go back to the products list, switch the admin to French, then use the “CPO Builder” link directly from the french product listing to only edit the CPO form.
The field IDs on the FR form are synced to the option IDs from the EN page. Great. I type module label texts, and save but with the “Save to DB?” unticked so I do not overwrite the other data for the module options in the DB.
Now I go to the product front end in French. The labels are in French. I select the various options. The calculation is fine. I add to cart. I go to the cart page. All the options are displayed in English. That’s how they will appear in the customer order. Not good.
Now, I go to the French version of the product and edit the CPO form. This time, I tick the “Save to DB?” for my modules. I go back to the front end. I switch to English. I add the product to the cart. I go to the cart page. The options are now displayed in French. Not good.
So, the options for the product in the cart are displayed using the labels the options had when the modules were saved with the “Save to DB?” option ticked. On top of that, the module editor will flick the “Save to DB?” option on automatically when you are change any of the fields with a yellow triangle. The user may not even realise or really understand what the subtle difference is.
The only way to deal with this is to have different field names for the form of each language so the options in the DB have the strings for each language. However, when you switch language, the cart will still display the product options strings in whatever language you were on when you added it to the cart. Plus you need to readjust the formula to use the language specific field names. Not good.
The setup is too inflexible and fragile in my opinion and you guys need to rethink it. Getting rid of the “Save to DB” concept and utilising the “CPO options” type translations from WPML would be a great start. “Save to DB” is just too much of an internal feature to present to the user in my opinion.
I think that when you “recommend using string translation functionality and translate existing forms this way” is misleading. You should just tell people that your plugin is not ready for multilingual sites or have a document detailing the compromises you need to make in a multilingual setup.
I am really looking forward to your version 5 and I hope that you will take my feedback as constructive. If I am wrong about all of the above I am open to your suggested way of doing things.
-
This reply was modified 5 years ago by
aris00.