• Resolved watermelonkid

    (@watermelonkid)


    So, I suppose I’m not understanding the process for the sticky subject in this forum for WPML support.

    I have five categories for the Events Calendar cats in English, and five categories in Spanish. If I update the colors in the Spanish versions, the English versions turn gray and lose their color settings.

    I have tried adding the cats via the teccc_add_terms() filter:

    add_filter( 'teccc_add_terms', function(){
        $translated_terms = array(
            'business-development',
            'career-development',
            'other-resources',
            'special-events',
            'youth-development',
            'desarrollo-de-carrera',
            'desarrollo-de-negocios',
            'desarrollo-juvenil-es',
            'eventos-especiales-es',
            'otros-recursos'
        );
        return $translated_terms;
    });

    I tried the above both adding the English cats and leaving them out. But this doesn’t seem to have any effect on making the English/Spanish cats maintain their colors either way. Would love to know what I’m doing wrong. Thanks!

    • This topic was modified 6 years, 2 months ago by watermelonkid.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 33 total)
  • Plugin Author Andy Fragen

    (@afragen)

    Can you share a screenshot of the Category Colors Settings?

    You shouldn’t need to duplicate the default language categories in the filter.

    • This reply was modified 6 years, 2 months ago by Andy Fragen.
    Thread Starter watermelonkid

    (@watermelonkid)

    Plugin Author Andy Fragen

    (@afragen)

    Can I ask where you have the filter placed?

    Plugin Author Andy Fragen

    (@afragen)

    After adding the filter to your theme’s functions.php or a site specific plugin and activating the plugin. These new categories should show in the Category Colors Settings page. You will then need to add colors, etc. and save.

    To remove the categories you will need to add change the filter name to teccc_delete_terms.

    Thread Starter watermelonkid

    (@watermelonkid)

    functions.php above all our other theme customizations

    Which new categories are you referring to–the categories already exist, both in English and Spanish. (?) Also, why would I want to delete them?

    Plugin Author Andy Fragen

    (@afragen)

    Just in case you ever changed categories you would need to remove those added by this filter. You could always do this from the Events Category page.

    You only need to add the translated categories that don’t exist. Per your image that would be only adding the Spanish.

    I’ve tested locally using the code you provided above, and all those categories were added for me, showing up in my Category Colors Settings so that I could set colors.

    Plugin Author Andy Fragen

    (@afragen)

    I see a problem. Let me work on it over the weekend and see if I can find a solution.

    Plugin Author Andy Fragen

    (@afragen)

    Can you copy and paste the results of get_option(‘teccc_options’); ?

    Also, if there’s a setting in WPML to translate the wp_options table and you’re translating, teccc_options this will cause issues.

    • This reply was modified 6 years, 2 months ago by Andy Fragen.
    Plugin Author Andy Fragen

    (@afragen)

    Does your Settings page show all the categories including the ones added from the filter?

    Thread Starter watermelonkid

    (@watermelonkid)

    Hey Andy,

    Yes, if I add new categories via the filter, they show up there. I can also delete them using teccc_delete_terms().

    So maybe this is the issue: we have English and Spanish categories already set up. Grabs:

    https://micasa.www75-98-173-71.a2hosted.com/english.png
    https://micasa.www75-98-173-71.a2hosted.com/spanish.png

    We don’t understand why saving the settings for one undoes the settings for the other. We don’t need to ADD the Spanish categories–they already exist and are being used in calendar.

    Plugin Author Andy Fragen

    (@afragen)

    Is it usual to switch the dashboard between locales?

    If you leave the dashboard in English and add the translated Spanish categories via the filter, what does the Settings page look like?

    Plugin Author Andy Fragen

    (@afragen)

    I think what happens is when you change the dashboard language you end up removing one set of categories.

    In order for both categories to exist you would need to either keep the dashboard language consistent and add the translated categories via the filter, or perhaps simply add all categories of every language via the filter. I think that should work.

    Plugin Author Andy Fragen

    (@afragen)

    @watermelonkid can you also try using my develop branch along with the above recommendations and let me know the results?

    https://github.com/afragen/the-events-calendar-category-colors/archive/develop.zip

    Thread Starter watermelonkid

    (@watermelonkid)

    Sorry for delay. Lots of balls in the air.

    Added your development branch (5.3.0.2). No success so far. I have tried removing all the cats and then adding them via the filter. Obviously this works in that we can assign colors to each cat in the English section. The problem is that then ALL these categories show up on the English version of the page…and none of them show up when you flip to the Spanish version (note filter buttons above calendar)

    English Month View
    Spanish Month View

    So because of this, the categories MUST be created separately from what I can tell, unless there is something I’m not understanding?

    Plugin Author Andy Fragen

    (@afragen)

    No problem. In looking at the actual English and Spanish pages, it appears that no categories are assigned to the events.

    I do see where using the legend will be problematic, though you might be able to use a filter to display specific categories depending upon the language or use a template override for /views/legend.php

Viewing 15 replies - 1 through 15 (of 33 total)
  • The topic ‘Don’t Understand WPML Fix/Application’ is closed to new replies.