• Resolved upwardspirals

    (@upwardspirals)


    Hello, I am using WPML. I have translated the categories.

    The issue I am having is I can only seem to add category COLORS to either English OR my second language (Spanish) and not BOTH. Everytime I add a color in the other language, it erases the colors in the first language I put it in. How do I fix this so the colors show in both languages?

    Thank you very much for your help!

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

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

    (@afragen)

    Have you looked at https://www.ads-software.com/support/topic/wpml-support-67/
    And searched for WPML in this forum?

    Thread Starter upwardspirals

    (@upwardspirals)

    Hi Andy, thank you. Yes I did see that support page… though I am very new to PHP and it was kind of confusing for me. Can you walk me through a bit using a couple of my actual categories?

    I wasnt sure if it should be written “en-espanol” or “in-Spanish” for each category?

    And do I write the same for each English category too?

    Sorry, I am a newb at php. Thank you so much

    Is this even close as an example? I have a category for Natural building, in spanish it is Construcción-Natural.

    ‘natural-building-in-english’,
    ‘natural-building-in-spanish’,

    then repeat in spanish?

    ‘Construccion-Natural-en-english’,
    ‘Construccion-Natural-en-inglés’,

    Or just write the one corresponding to the correct language or repeat each category 4 times like above? So sorry. Thank you for walking me through a bit.

    —————————————————————————–
    Your format below

    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;
    });
    Plugin Author Andy Fragen

    (@afragen)

    Essentially you are added the term in every language. If you are using 3 languages you would need to add the term in each of those languages.

    This will make using the legend impossible without some custom programming.

    In your above example you would need to add the Spanish translations too.

    You don’t need to designate what language it’s in in the term. I did that mostly for the example.

    Thread Starter upwardspirals

    (@upwardspirals)

    Hello Andy, ok thank you so much!

    Ok, so i think i did what you said… though I see i no change. Can you look at this code and tell me if it is correct? The first 9 are the English categories, and the next 9 are the spanish translated categories.

    THANK YOU SOOO MUCH!!!

    add_filter( 'teccc_add_terms', function(){
            $translated_terms = array(
                    'Community-Outreach',
                    'Economics',
                    'Ecosystem-Regeneration',
                    'Kids-Activities',
                    'Natural-Building',
                    'Permaculture-Farming',
                    'Personal-Wellness',
                    'Social-Gatherings',
                    'Sustainabilty',
                    'Actividades-para-Ni?os',
                    'Alcance-Comunitario,
                    'Bienestar-Personal',
                    'Construcción-Natural',
                    'Economía',
                    'Permacultura-Agricultura',
                    'Regeneración-Ecosistema',
                    'Reuniones-Sociales',
                    'Sostenibilidad',
            );
    
            return $translated_terms;
    });
    Plugin Author Andy Fragen

    (@afragen)

    Can you screenshot your Category Colors settings page?

    Thread Starter upwardspirals

    (@upwardspirals)

    Thank you!!!!

    https://paste.pics/FTHUC (English)
    https://paste.pics/FTHUM (Spanish)

    Also, I noticed some errors with accents and such… adjusted below (though it is still not working). Thank you for your help!!!

    add_filter( 'teccc_add_terms', function(){
            $translated_terms = array(
                    'Community-Outreach',
                    'Economics',
                    'Ecosystem',
                    'Kids-Activities',
                    'Natural-Building',
                    'Permaculture-Farming',
                    'Personal-Wellness',
                    'Social-Gatherings',
                    'Sustainabilty',
                    'Actividades-Ninos',
                    'Alcance-Comunitario',
                    'Bienestar-Personal',
                    'Construccion-Natural',
                    'Economía',
                    'Permacultura-Agricultura',
                    'Ecosistema',
                    'Reuniones-Sociales',
                    'Sostenibilidad',
            );
    
            return $translated_terms;
    });
    Plugin Author Andy Fragen

    (@afragen)

    You need to set the same colors for the translated categories. I’m referring to the second screenshot.

    Thread Starter upwardspirals

    (@upwardspirals)

    Yes, though every time i add colors in the second language, it erases all the colors in the English language.

    This is why I need support. Thank you!!

    Plugin Author Andy Fragen

    (@afragen)

    Can you screenshot the Event Categories page? All the categories, both English and Spanish should be present.

    Plugin Author Andy Fragen

    (@afragen)

    Are you removing the above filter code?

    Thread Starter upwardspirals

    (@upwardspirals)

    I still have the code in the PHP Code Snippets plugin

    https://paste.pics/FTIA1 (English)
    https://paste.pics/FTIA4 (Spanish)

    Plugin Author Andy Fragen

    (@afragen)

    Is there some setting in WPML that only displays certain language categories? You need it to display all of them.

    Thread Starter upwardspirals

    (@upwardspirals)

    I believe this is the WPML setting you are referring to. And looks right

    https://paste.pics/FTIDR

    Plugin Author Andy Fragen

    (@afragen)

    Try selecting non-translatable. You will likely not be able to use the default legend.

    Thread Starter upwardspirals

    (@upwardspirals)

    I believe this is now working! Whew! Thank you!!! Really appreciate your help!

    The only issue now is:

    – When i switch languages, it doesnt refresh the category colors right away, i have to refresh the page first. Any thoughts?

    – and sometimes while clicking the month next button, or List view, it switches languages. Any thoughts?

    You are awesome! Thank you so much!!!!

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘WPML – colors only show on one language’ is closed to new replies.