JavaScript function for dynamic content translation
-
Hi All, is there a global JavaScript function I can call to make your plugin re-translate dynamic content that is loaded into the page via AJAX or in an iframe? For example, something like etm.translatePage(). Thank you.
-
Hello,
Unfortunately, the plugin does not offer a global JavaScript function. However, it automatically translates dynamic content by default.
Thank you for your reply. By default I think so too, but for some reason this is not the case with The Events Calendar. Do you have any experience with this plugin or anyone else? Thanks in advance!
Hello Support Team,
We are experiencing a critical language synchronization issue on our website, which uses both the WEB-T multilingual plugin and The Events Calendar.
Environment:
Multilingual Plugin: WEB-T
Events Plugin: The Events Calendar
Theme/Builder: Bricks Builder
Screenshots:
https://share.zight.com/ApudzBrB
https://share.zight.com/rRuRjyL2
Problem Description:
Our setup involves a main page managed by WEB-T (using URL slugs like /en/ and /de/ for language) and an embedded calendar from The Events Calendar, which is displayed in an iframe. The language of the parent page and the iframe content are not synchronized.
The issue is two-fold, as demonstrated in the attached screenshots:
Scenario 1:
The parent page URL is correctly set to /en/, and the main language switcher in the site header shows “English”.
However, the embedded The Events Calendar iframe completely ignores the parent page’s language. It loads in the default language (Hungarian), and its own internal language switcher shows “Hungarian”.
Scenario 2:
This demonstrates a deeper problem. Even when we manually change the language switcher inside the iframe to “English”…
…the actual calendar content (the month name “augusztus”, day names “HET”, “KED”, etc.) remains untranslated in Hungarian.
This indicates that the embedded view is failing to load the correct .mo language file for English, even when explicitly instructed to do so by its own switcher.
What we have tried:
We have attempted several solutions, including server-side PHP snippets to force the WordPress locale based on the parent URL, and client-side JavaScript to dynamically change the iframe’s src URL to include a language code. None of these have resolved the core issue of the iframe’s inability to load the correct language files.
Our Questions:
For WEB-T Support: How can the language selected on the parent page be programmatically passed to an embedded iframe on the same domain? Does your plugin offer a specific URL structure, query parameter, or JavaScript event that we can use to enforce language synchronization with iframes?
For The Events Calendar Support: Why does the embedded calendar view (/calendar-embed/…) fail to load its translation files (.mo files) even when its internal language switcher is set to a different language? Is this a known issue, and is there a required parameter or method to correctly initialize the embedded view with a specific language?
This issue is critical for our multilingual user experience. Any guidance you can provide would be greatly appreciated.
Thank you for your time and assistance.
Best regards,
PeterHello @hgeorge89 and @peterteszary,
Thank you for reaching out!
We conducted some tests and found that the WEB-T plugin successfully translates most of the content on the “The event calendar” page:
http://www.your-domain.com/events/
When a different language is selected, the plugin translates all visible text on the page. However, the abbreviated day names (e.g., MON, TUE) remain unchanged because the translation server doesn’t recognize them as translatable words. The same limitation applies to abbreviated month names (e.g., JAN, FEB).To address this, you can manually translate these abbreviations using the “Translate Page” option available at the top of the page.
As for the iframe, Web-T is unable to translate its content because an iframe essentially loads a separate website within your page. Since the plugin only processes text directly embedded in your site, anything inside the iframe falls outside its scope.
@ecwebt ,
I am experiencing a persistent issue where I am unable to override a template file to customize the month view. My goal is to display the full names of the weekdays instead of the default abbreviations. After extensive debugging, it appears the template override is being ignored, and the setting to switch between view versions (v1/v2) is missing.
My Environment:
- The Events Calendar Version:
[Your Events Calendar Version] - WordPress Version:
[Your WordPress Version] - Theme: Bricks Builder with a child theme.
- Language: Hungarian (
hu_HU)
## Problem Description
My goal is to display the full weekday names (e.g., “Hétfő” instead of “HET”) in the calendar’s month view header.
1. Attempted v2 Template Override (Failed)
Following your documentation, I created a template override file in my child theme at this location:
wp-content/themes/my-child-theme/tribe/events/v2/month/calendar-header.phpInside this file, I modified the code to echo the full day name (
<?php echo esc_html( $day ); ?>). However, this change had no effect on the front end.2. Proving the Override File is Not Loading
To confirm that the file was being ignored, I added a simple
<h1>TEST</h1>tag to the top of my overriddencalendar-header.phpfile. After clearing all caches (plugin, server, and browser), the “TEST” text did not appear. This proves that the WordPress template hierarchy is not loading my override file for some reason.3. Investigating the View Version (v1 vs. v2)
The only logical conclusion was that my site is not using the “Updated (v2)” views, but is instead stuck on the “Legacy (v1)” views, thus ignoring the
/v2/directory.However, the setting to switch between “Legacy (v1)” and “Updated (v2)” views is completely missing from my settings pages. I have checked thoroughly under Events → Settings → Display and Events → Settings → General, and the option is not present in either location.
4. Temporary Workaround
As a temporary fix, I am now using a JavaScript snippet to forcibly rewrite the weekday names in the user’s browser after the page loads. This works, but it’s not an ideal solution as it can cause a “flash” of incorrect content and is dependent on the theme’s HTML structure.## My Questions
- Why is my template override at
.../tribe/events/v2/month/calendar-header.phpbeing completely ignored by the plugin? - Why is the setting to switch between “Legacy (v1)” and “Updated (v2)” views missing from my admin panel?
- Is there a constant (e.g., in
wp-config.php) or a filter that could be forcing my site into Legacy mode and hiding this setting? - Given this situation, what is the correct, recommended method to customize the month view header to show full weekday names?
Thank you for your time and assistance in resolving this issue.
Best regards, Péter
Hello @peterteszary
The issue appears to be related to either The Events Calendar plugin or WordPress itself. Unfortunately, there’s not much we can do to assist from the WEB-T side.
We remain at your disposal should you need anything else regarding the WEB-T plugin.
Best regards,
WEB-T Team
- The Events Calendar Version:
You must be logged in to reply to this topic.