Title: Translation support?
Last modified: September 27, 2018

---

# Translation support?

 *  Resolved [jvier](https://wordpress.org/support/users/jvier/)
 * (@jvier)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/translation-support-15/)
 * Hello, I’m working with this plugin along with the WPML plugin to create three
   calendars based on the language chosen by the user. The problem seems to be that
   the plugin does not support translation and bugs out when trying to set the colors
   for the categories. It overwrites the other languages color settings and displays
   the events with white background.
    I’d appreciate if you could help me with this
   issue or tell me if you plan to add translation support in the future. Thanks
   in advance.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/translation-support-15/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/translation-support-15/page/2/?output_format=md)

 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8652391)
 * Unless there’s a function to get all the translated category terms the only way
   to make this work is to turn off translation of category terms.
 * If you know of a function in WPML that can get all the translated category terms
   I might be able to fix this.
 *  Thread Starter [jvier](https://wordpress.org/support/users/jvier/)
 * (@jvier)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8662334)
 * Hi, sorry for the delayed response.
    I’m not sure what you mean by “a function
   that can get all the translated category terms”. Do you mean it as in “a function
   that lets you edit the translated category themes”. Because in that case there
   is one.
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8662506)
 * Take a look at [https://wordpress.org/support/topic/colors-disappear-with-wpml-multi-language-site/](https://wordpress.org/support/topic/colors-disappear-with-wpml-multi-language-site/)
 * What I would need is a function like `get_terms()` but that would also return
   the translated terms that WPML produces.
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8662522)
 * If you have a listing of all the translated terms you could use the filter hook`'
   teccc_get_terms'` to add the translated terms.
 * Something like,
 *     ```
       add_filter( 'teccc_get_terms', 'wpml_translated_tec_category_slugs' );
       function wpml_translated_tec_category_slugs( $all_terms ) {
           $translated_terms = array( 'translated_term1', 'translated_term2', ... );
           $merged_terms = array_merge( $all_terms, $translated_terms );
           return $merged_terms;
       }
       ```
   
 *  Thread Starter [jvier](https://wordpress.org/support/users/jvier/)
 * (@jvier)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8669400)
 * I tried applying the code you sent me (putting the category slugs in the ‘translated_termx’
   slots) and it does spread the colors to the translations but the calendar disappears
   completely from the frontend only leaving the legend categories.
    I entered the
   code as follows,
 *     ```
       add_filter( 'teccc_get_terms', 'wpml_translated_tec_category_slugs' );
       	function wpml_translated_tec_category_slugs( $all_terms ) {
       	$translated_terms = array( 'atelier-cuisine-en-anglais', 'atelier-cuisine-en-espagnol', 'atelier-cuisine-en-francais', 'cooking-classes-in-english', 'cooking-classes-in-french', 'cooking-classes-in-spanish' );
       	$merged_terms = array_merge( $all_terms, $translated_terms );
       	return $merged_terms;
       	}
       ```
   
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8670125)
 * Can you provide the contents of all the variables? It would help in troubleshooting.
 *  Thread Starter [jvier](https://wordpress.org/support/users/jvier/)
 * (@jvier)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8671522)
 * I’m afraid I don’t know how to get the variables from the plugin. If you could
   reference me to a tutorial or plugin that does this I’ll provide the variables.
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8672520)
 * I think I’ve been able to update the plugin to add category terms via a filter.
   This should bring WPML compatibility.
 * I’ve done some testing locally but it would be nice if someone could test my 
   code. You can do this by downloading my develop branch from [https://github.com/afragen/the-events-calendar-category-colors/archive/develop.zip](https://github.com/afragen/the-events-calendar-category-colors/archive/develop.zip)
   and install it.
 * You will need to deactivate the current version.
 * Once installed, you can add your translations using code similar to the following.
 *     ```
       add_filter( 'teccc_add_terms', function(){
       	$translated_terms = array(
       		'atelier-cuisine-en-anglais',
       		'atelier-cuisine-en-espagnol',
       		'atelier-cuisine-en-francais',
       		'cooking-classes-in-english',
       		'cooking-classes-in-french',
       		'cooking-classes-in-spanish',
       	);
   
       	return $translated_terms;
       });
       ```
   
 * You can remove terms either from the Event Categories page or from using another
   similar filter.
 *     ```
       add_filter( 'teccc_delete_terms', function(){
       	$translated_terms = array(
       		'atelier-cuisine-en-anglais',
       		'atelier-cuisine-en-espagnol',
       		'atelier-cuisine-en-francais',
       		'cooking-classes-in-english',
       		'cooking-classes-in-french',
       		'cooking-classes-in-spanish',
       	);
   
       	return $translated_terms;
       });
       ```
   
 * Don’t use both filters at the same time.
 *  Thread Starter [jvier](https://wordpress.org/support/users/jvier/)
 * (@jvier)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8674994)
 * Using the updated plugin and the add_terms filter don’t seem to have changed 
   anything besides the fact that the add_terms filter keeps adding categories everytime
   the calendar page is loaded.
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8675011)
 * It doesn’t seem to keep adding more and more for me. Can you delete all the added
   categories then check the Event Categories page to make sure they are gone and
   then try again.
 * I’ll keep testing too.
 *  Thread Starter [jvier](https://wordpress.org/support/users/jvier/)
 * (@jvier)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8675154)
 * It keeps adding regardless.
    I think maybe it’s because I add the filter to the
   wrong file, what file are you editing it in?
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8675270)
 * I think I need to put in a check to see if the term already exists. I’ll see 
   about adding this tonight.
 * If you download, install, and activate. GitHub Updater you will get an update
   notification for the develop branch when I fix this.
 * [https://github.com/afragen/github-updater/archive/master.zip](https://github.com/afragen/github-updater/archive/master.zip)
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8676573)
 * I just pushed a commit to check for the existence of the term before it adds 
   it. This should take care of the duplicate issue.
 * Can you confirm?
 *  Thread Starter [jvier](https://wordpress.org/support/users/jvier/)
 * (@jvier)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8676625)
 * Yes, it works perfectly now both the categories and the colors. Thank you.
 *  Plugin Author [Andy Fragen](https://wordpress.org/support/users/afragen/)
 * (@afragen)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/translation-support-15/#post-8676631)
 * Thanks so much for testing. I’ll push out a release.
 * Be sure to leave a review!
    -  This reply was modified 9 years, 7 months ago by [Andy Fragen](https://wordpress.org/support/users/afragen/).

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/translation-support-15/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/translation-support-15/page/2/?output_format=md)

 The topic ‘Translation support?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/the-events-calendar-category-colors_52b1d1.
   svg)
 * [The Events Calendar: Category Colors](https://wordpress.org/plugins/the-events-calendar-category-colors/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar-category-colors/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar-category-colors/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar-category-colors/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar-category-colors/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar-category-colors/reviews/)

 * 16 replies
 * 3 participants
 * Last reply from: [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/translation-support-15/page/2/#post-10727296)
 * Status: resolved