08/25/2016 at 7:26 am #387752
I hope you are well.
Our client has their websites in 4 languages (eng, french, spanish, portuguese)
We just need to add their “Job Title” in each language.
We are using WPML for translations, and have raised this ticket with them as well.
When we use WPML “String Translation” to attempt to translate, we can only see the user/admin fields. We don’t want to translate the plugin itself. Just enter the job title for the Person, in some different languages.
Any experience with this process or advice that we should follow? At the moment it’s just in English for every site, with apparently no way of adding the other languages.
Greg08/30/2016 at 11:28 am #388242
I believe my support ticket may have been missed as I see many others have been answered in the meantime.
Please could you give it some attention? I have spoken with WPML about the issue too, they find some strange behaviour from Connections custom post type/
Here is the thread:
Thank you08/30/2016 at 1:07 pm #388310
Steven ZahmKeymasterPost count: 12935
Apologies! I somehow did miss this.
I’ve read the thread over in the WPML support forum…
I guess the first thing that needs to be clarified is that Connections is not a custom post type (CPT). Connections uses custom database tables instead for a couple reasons. One, Connections is older than the WP CPT feature. Two, and more importantly, the db schema of the custom tables are more optimized for directories whereas CPT’s are optimized for post content. This allows me to do things which are difficult is not possible if I were to use a CPT. This is very likely you are not seeing what you need to see in WPML.
Looking at the WPML developer docs, it seems, I think I would have to add specific support in the code for WPML support for user input as outline in their docs.
I could not find anything in their dev docs specifically outlining the procedure to add WPML support to plugins which use custom tables and with user input. I’m not able to ask questions in their support forum since I’m not a customer. If you could relay this question to them asking them to point me to the relevant docs. I can at least add initial support for the job title field.
If this will help them, the code to get and set the job title can be found in these two links:
The actual data is retrieved and saved from the db using the WordPress wpdb API.
I hope this helps move this issue forward to resolution. Let me know what you find out.08/31/2016 at 6:13 am #388413
I will relay this to them and let you know what they come back with,
Greg12/08/2016 at 8:50 am #402721
I hope all is good. This thread got lost for a while, but I’m keen to pick it up with you and WPML
In response to the above, WPML said:
“Let Steven know he could create a manual xml file with the set strings names which would force WPML to register them in the String Translation table. Then he would have to program the translation to force them to use his own domain.
The best way to get in touch with our developers to make this plugin compatible is to join our Go Global Program (https://wpml.org/documentation/theme-compatibility/go-global-program/). Feel free to forward this to him and have him fill out that form so we can start working together.”
Does that seem do-able?
Thanks, all the best
Greg12/22/2016 at 10:39 am #404649
Steven ZahmKeymasterPost count: 12935
When they say create an XML file, I assume this is what they are talking about from their documentation:
It sounds like you would need to create this XML file… I can’t create an XML file containing string I do not exist in my code. But I do not think this is a solution based on their docs.
You want to translate the actual contents of the job title field, correct? Only you have those strings because they exists only in your database. The field label itself can already be translated, if that is what you are asking about, as the plugin is completely localization ready. It has been for a long time now and is.
Now if we are talking about the field content, it does not appear that an XML file is the solution, that seems to be only required for the static strings in the plugin.
I’m unable to find any documentation which covers how to make field contents translatable for content which exists in custom tables. Everything seems to focus on post/page/widget/taxonomy content. If there was some type of filter or function I could apply to the string before being displayed, I would more than happily apply it but I simply can not find any documentation which covers exactly what you are asking to be done.