This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Compatibility
This topic contains 4 replies, has 2 voices.
Last updated by Mary 5 days, 14 hours ago.
Assisted by: Marcel.
Author | Posts |
---|---|
November 6, 2024 at 4:24 pm #16373714 | |
Mary |
Background of the issue: Symptoms: Questions: |
November 7, 2024 at 10:49 am #16376425 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, Please be aware that Advanced Views is not certified for WPML, so we cannot guarantee that it fully supports the proper use of getText() calls. The generated multilingual.php file lacks the required textdomain in its getText() calls, as outlined here: https://wpml.org/documentation/support/translating-the-theme-you-created/#adding-gettext-calls-to-php-code. For reference, the correct use of textdomain is shown in the example code here: hidden link. Best regards, |
November 7, 2024 at 12:47 pm #16377480 | |
Mary |
Yes, in that support page (hidden link), it says "Advanced Views uses the built-in WordPress translation function __('field label', 'themeDomain') for all View and Card labels. This allows you to translate labels seamlessly using your preferred multilingual plugin, eliminating the need for creating a separate View or Card for every language." So I'm not sure why I can't see the labels automatically in the string translation? What I understood was that I had to activate their File system storage so it would create a scannable file in my child theme for WPML and other multilingual tools, but what you are saying is that I need to edit this file with the correct textdomain? If so, which textdomain do I have to use? My theme's (generatepress)? The ACF Views's textdomain (acf-views)? Lastly, I did add a label manually in the template (<h2>{{ __('Coordonnées', 'generatepress') }}</h2>) and it was automatically added to their multilingual file in my child theme (last line in the attachment), but I still don't see it in string translations, even after rescanning the file for new strings. I will contact them to see that I'm following their steps correctly, but if I am, is there a reason why I can't see the strings in WPML even when I add the textdomain (as I did for one string as seen in attachment)? |
November 7, 2024 at 3:00 pm #16378450 | |
Marcel Supporter
Languages: English (English ) German (Deutsch ) Timezone: Europe/Madrid (GMT+01:00) |
Hi, in theory, yes, but this plugin works a bit differently. Typically, a getText() call is made directly within the plugin's PHP file, not in a generated file. The text domain itself doesn’t matter much—it’s just an identifier. You can try using "test" as a placeholder.
This seems to be the main issue—the getText() call wasn’t set up correctly. If you adjust it here, it should generate properly in the file. Here are the steps to try: 1) Modify one string, ensuring it includes a text domain. Best regards, |
November 8, 2024 at 7:56 pm #16383422 | |
Mary |
Thanks. I did what you said and it worked for the label I had created manually, but not for the others. That said, I did hear back from the author of the plugin. They explained their plugin picks up the text domain automatically, based on the ‘Text Domain’ setting, defined in the heading of style.css of the theme. Since my child theme didn't have a text domain setting, it wasn't working. Now that I've defined it, it works. Thank you for your time. |