Home › Forums › Basel support forum › Change "Show Sidebar" string
Change "Show Sidebar" string
- This topic has 9 replies, 2 voices, and was last updated 5 years ago by Elise Noromit.
-
AuthorPosts
-
November 21, 2019 at 3:38 pm #158254
algeorgiadisParticipantHello I would like to change the “Show Sidebar” text for the mobile off canvas sidebar to “Show Filters”, how can I do this?
Thank you very muchNovember 21, 2019 at 3:59 pm #158257
Elise NoromitMemberHello,
You can translate all theme and plugin texts via PO file in WordPress. Here is a video tutorial that should help you translate your website texts with a Loco Translate plugin https://www.youtube.com/watch?v=D3NsDdMzsls&list=PLMw6W4rAaOgKKv0oexGHzpWBg1imvrval&index=3
Best Regards
November 21, 2019 at 4:04 pm #158259
algeorgiadisParticipantI understand How I can translate, but I am using WPML and I want it to be show filters for english and “show filters” in greek language as well
I know that the string is in \basel\inc\woocommerce.php on line 2570 but can I override it with a function? because I don’t want to change the base theme files fo future updates.
(ps. I have a child theme)November 22, 2019 at 8:46 am #158339
Elise NoromitMemberHello,
Please synchronize the translation as shown on the screen https://prnt.sc/q0gqlp
Best Regards
November 22, 2019 at 8:55 am #158345
algeorgiadisParticipantI must rephrase.
When I am in the english version of the website I see “show sidebar” and right now I am developing the greek frontend.
I want this string to be “show filters” for the english version of the site (which is hardcoded right now in the \basel\inc\woocommerce.php on line 2570) and “Φίλτρα” for the greek version of the frontend.
In order to translate the string I first need to override it from “show sidebar” to “show filters” and then translate it. Is there any way to do it with out changing in the core file (\basel\inc\woocommerce.php on line 2570)? by copying this file for example in my child theme or should I change the string directly and have it in mind to change it every time I update the theme?November 22, 2019 at 9:00 am #158346
Elise NoromitMemberHello,
WPML is a multilingual plugin and it does not provide the option to change the wording. It takes the existing phrase and provides the option to translate it. That is why I suggested the Loco plugin. You change the wording and then make the translation. Please refer to the documentation of WPML or contact their support and check the Loco documentation.
Best Regards
November 22, 2019 at 9:14 am #158349
algeorgiadisParticipantI know that wpml can not change the wording that is why I asked how to override the standard string “show sidebar” with code in functions.php or by copying and altering the woocommerce.php file in my child theme folder.
Nevermind I created a function to alter strings.
For anyone who is interested in this here’s the function:// Change the show sidebar tag function my_altered_strings( $altered_text, $text, $domain ) { switch ( $altered_text ) { case 'Show sidebar' : $altered_text = __( 'Show filters', 'woocommerce' ); break; } return $altered_text; } add_filter( 'gettext', 'my_altered_strings', 20, 3 );
Thank you.
November 22, 2019 at 9:19 am #158351
Elise NoromitMemberOk. If you have any questions please feel free to contact us.
Best Regards
November 22, 2019 at 9:22 am #158352
algeorgiadisParticipantThank you very much for your time Elise.
Have a nice day.November 22, 2019 at 9:57 am #158359
Elise NoromitMemberYou are welcome!
-
AuthorPosts
Tagged: Off Canvas Mobile Sidebar, show sidebar
The topic ‘Change "Show Sidebar" string’ is closed to new replies.
- You must be logged in to create new topics. Login / Register