Home › Forums › Additional Help › Translations › Languages not working with customized template files
- This topic has 6 replies, 1 voice, and was last updated 10 years, 7 months ago by
George.
-
AuthorPosts
-
September 24, 2015 at 5:39 am #1008206
Eugene
GuestI have WP theme with customized The Event Calendar files.
wp-content\themes\my_theme\tribe-events\single-event.php
In this file I have such line
<a href="<?php echo esc_url( tribe_get_events_link() ); ?>"> <?php printf( __( '« All %s', 'the-events-calendar' ), $events_label_plural ); ?></a>“All” is not translated, but if I delete this file, it works with default file wp-content\plugins\the-events-calendar\src\views\single-event.php
How I can solve this problem?September 24, 2015 at 8:15 am #1008346George
ParticipantHey Eugene,
This problem stems from the fact that translations rely on the plugin’s .mo and .po language files, which are generated anew before each release of the plugin.
The problem is that these files point to strings in the core plugin, so if you have a customized template, then this new custom file in your theme is not a part of the .mo and .po files and so will not be translated as part of The Events Calendar.
The only solution would be to generate new .mo and .po files – you can search online for information on how to do that, there are a number of ways.
I hope this information helps!
— George
September 25, 2015 at 12:10 am #1008613Eugene
GuestHi, George
Thank you for your help!September 25, 2015 at 7:14 am #1008685Eugene
GuestYet there is more I would like to ask. Is there a chance this could work alike with WooCommerce plugin, where the translations apply even to a re-written plugin file, as far as the .po and .mo files have the needed words and phrases added.
In woocommerce plugin all languages works fine in custom files(wp-content\themes\my_theme\woocommerce\single-product-reviews.php) This file take translation from wp-content\languages\plugins\lang_Lang.po
Please let me know if that is clear enough, thanks!
September 25, 2015 at 11:18 am #1008768George
ParticipantWow, I didn’t know that WooCommerce was able to do that, that is awesome! The fact that it is possible does give me hope that, yes, at some point we could add functionality for this to ensure translation files were up-to-date with custom templates.
For now there is still no way, unfortunately 🙁
I’m sorry to disappoint Eugene!
Sincerely,
GeorgeSeptember 27, 2015 at 11:53 pm #1009098Eugene
GuestOk. Thanks for the quick response
September 29, 2015 at 7:12 am #1009641George
ParticipantSorry to have had to share bad news, Eugene 🙁
Best of luck with your site!
George -
AuthorPosts
- The topic ‘Languages not working with customized template files’ is closed to new replies.
