• Hello all,

    I added a custom code in functions.php and I messed it out..
    I translated some words from english to greek but I when I switch the language in English (TranslatePresse) I see the works in greek too. So I am trying to find a way to undo these custom functions that I added.
    Do you have any idea ?

    Thank you

    function multi_change_translate_text( $translated ) {
        $text       = array(
            '?ρε? καταστηματο?' => 'Store Hours',
            'ρυθμ?σει? ?ρε? καταστηματο?' => 'Store Hours Settings',
    		'Enable Store Hours' => 'ss',
    		'Enable Store Hours' => 'ss',
            
        );
        $translated = str_ireplace( array_keys( $text ), $text, $translated );
        return $translated;
    }
    add_filter( 'gettext', 'multi_change_translate_text', 20 );
Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Just remove the function and the add_filter line. None of the changes you made were permanent.

    Thread Starter mairh93

    (@mairh93)

    Hello,

    I deleted them, I published again the code, but the translation in the vendor page remains

    I had also, for test purpose, put instead of Enable Store Hours ->SS, and now as I trying to do the invert, all the SS in my side have become Enable Store Hours. For example : PaEnable Store Hoursword inseatd of Password

    Do you know how I could make the translations as before editing the function.php code?

    Generally, which is the best way to edit this function.php, in order to avoid the bugs like it.? It seems now that I cannot undo this function in the core .php (Apperance>Theme File Editor> Theme function

    Thank you for your help!

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    What do you mean you cannot undo it? How about downloading a fresh copy of the theme’s .zip file, extracting functions.php, and uploading that in place of the one you’ve edited.

    Thread Starter mairh93

    (@mairh93)

    Hello,

    I have the Rehub theme and I cannot find a way to download the .zip file. Could you please provide me more details ?

    Generally, I don’t know if it will helps, as I tried already to manually delete the custom code that I added in the function.php and nothing changed.

    Thank you for your time!

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Thread Starter mairh93

    (@mairh93)

    yes

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Download a fresh copy to obtain the .zip file.

    Thread Starter mairh93

    (@mairh93)

    ok I will try.

    But when I add a custom code in the function.php save the changes, and after go back and delete the custom added code, and save again, I see that the changes remain. Is it normal ? Does it mean that the changes in the function.php are permanent ?

    Thank you for your time!

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    No. Disable any caching.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘functions.php – translation undo’ is closed to new replies.