[Resolved] WPML string in Layouts Visual Editor cell
This thread is resolved. Here is a description of the problem and solution.
Problem:
The issue here is that when the user uses the [wpml-string context="my own context" name="my own stringname"]mystring[/wpml-string] shortcode the context and name attributes don't show up correctly in WPML String Translations. This only happens if they are used in the Visual Editor cell in Layouts.
Solution:
Unfortunately we don't have a solution at this time. However our development team has been aware of this issue and is currently working on fixing this.
This support ticket is created 6 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
I use the wpml-string shortcode, e.g. [wpml-string context="my own context" name="my own stringname"]mystring[/wpml-string] in a Layouts Visual Editor cell.
Translation option is set to "Only text in [wpml-string] will appear for translation".
Then I go to WPML - String translation and find the string with the domain "layout-985" and name "s262_content_wpml-string_169319501261c644a58610f967e8f9d0".
So I can't use the shortcode context and name attributes in a Layouts Visual Editor cell? As far as I remember, it has worked before, and the behavior changed after a Toolset and/or WPML update.
What is the correct behavior nowadays and where is it documented?
I'm not sure what you mean with copy and paste, can you please clarify?
I'll also make an attempt to clarify the issue. The translation is actually working per se, but I can't make use of the context and name attributes to the wpml-string shortcode. This makes it hard to find what to translate and I believe that the shortcode attributes were working last year.
Please find attached a screenshot where the top phrase comes from [wpml-string context="my own context 1" name="my own stringname 1"]string 1[/wpml-string] in a Layouts Visual Editor cell. You can also see that the attributes are working fine when the wpml-string shortcode is used in Content templates and Views.
For my current project, I just want to translate the strings marked with the [wpml-string] shortcode and I want to use the WPML String Translation view to translate everything. Hence I'm not using the WPML Translation Management feature.
As you've seen, this works fine when I use the shortcode in Content Templates and Views. The shortcode also works for Layouts Visual Editor cells, but with a big drawback, which is the missing ability to specify Domain and Name for the String Translation view.
I'm certain that your team will mention that it's working as expected when using the WPML Translation Management feature, but this is not what I'm looking for. I'm looking to translate the whole site (excl posts) right in the WPML String Translation view.