• Resolved imborx

    (@imborx)


    Hi,

    I tried to translate days of the week (mon, tue…) and months into other language and I wasn’t capable. I tried using Loco Translate and also using a tweak like this but I wasn’t sucesfull (I could with “Search events…” and “day, week, month” but not other ones):

    add_filter( ‘gettext’, ‘bbloomer_translate_woocommerce_string’, 999 );

    function bbloomer_translate_woocommerce_string( $translated ) {
    $translated = str_ireplace( ‘TEXTO-ORIGEN’, ‘TU-TRADUCCION’, $translated );
    return $translated;
    }

    How can I translate that strings?

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author moiseh

    (@moiseh)

    Hello Sir,
    This snippet you using used, worked to me, added in my theme functions.php:

    add_filter( 'gettext', 'bbloomer_translate_woocommerce_string', 999 );
    function bbloomer_translate_woocommerce_string( $translated ) {
    	$translated = str_ireplace( array('month', 'week'), array('mth', 'wk'), $translated );
    	return $translated;
    }

    I’ll investigate the reason why not working with Loco Translate when possible.
    Regards

    Thread Starter imborx

    (@imborx)

    @moiseh hi, thanks for your reply. Mi snippet works just with certain words, but not with others like Juanuary, February, Mon, Tue, Wed… can you tell me where can I replace that words in code? Because any other solution worked actually for me ??

    Cheers!

    Plugin Author moiseh

    (@moiseh)

    Actually the responsible for this words translation like month names it’s the FullCalendar javascript component. ( https://fullcalendar.io/docs/locale )

    I’ll add this locale compatibility when possible and try to release it soon.

    Thread Starter imborx

    (@imborx)

    Thank you so much, I’ll wait for that. Congrats for a fantastic plugin and I really appreciate your fasta support.

    Cheers!

    Plugin Author moiseh

    (@moiseh)

    Thanks

    Released support for other languages in v1.0.14
    It can be changed under plugin settings.

    Thread Starter imborx

    (@imborx)

    Wow @moiseh, if I could, I’d give you 6 stars! Amazing support.

    Thanks again ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Translate certain strings’ is closed to new replies.