Home › Forums › Legacy Support › Support queries › Translation issues › change one word
- This topic has 18 replies, 2 voices, and was last updated 4 years, 8 months ago by logan.
-
AuthorPosts
-
June 26, 2019 at 12:42 pm #215621MeesterGijsSpectatorWhere and how can I change this word? Underneath the login... imageJune 27, 2019 at 6:35 am #215733loganMemberHello, add this code in your customizer plugin. add_action('init', function(){ ?> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> jQuery(document).ready(function($){ $("body.login div#login p#nav>a:first-child").text("translated register text should be here!!"); }); </script> <?php }); refer: http://prntscr.com/o79ul0June 27, 2019 at 7:26 am #215751MeesterGijsSpectatorThat worked! Thanks. You can close this one.June 27, 2019 at 11:47 am #215837MeesterGijsSpectatorDon't close! I noticed that the code gave unlimited jquery errors. And it made my courses page be blank... Any idea how come? I deleted the code and the page loaded perfectly fine again. :)June 27, 2019 at 11:48 am #215838MeesterGijsSpectatorIs there not a way to translate the word using Loco translate?June 28, 2019 at 6:25 am #215956loganMemberPlease try to find in wplms theme and BuddyPress plugin. don't forget to sync.June 28, 2019 at 10:14 am #216018MeesterGijsSpectatorI found such a string in Buddypress but it didn't change on the site after adjusting the translation and saving and syncing it. Perhaps because I dont have a local buddypress file?June 29, 2019 at 5:51 am #216158loganMemberi have searched thoroughly and found that this is coming from wordpress itself. whatever you select as your site language, it automatically translate in that language.June 29, 2019 at 11:31 am #216194MeesterGijsSpectatorIs it possible to change that?July 1, 2019 at 8:01 am #216299loganMemberNope, i did not find a working solution for this yet. refer: https://wordpress.stackexchange.com/questions/217880/cant-change-language-only-english-united-states https://wordpress.stackexchange.com/questions/126620/how-to-translate-wrong-password-messageJuly 1, 2019 at 5:16 pm #216413MeesterGijsSpectatorDear Logan, Your first link doesn't refer to my issue. I have the Dutch language set. I want a Dutch word translated to another Dutch word.. With regard to your second link. I have the text changed that you see after wrong username/passwoord. I've added it at the bottom of this post. I'm talking about this one word. code: add_filter('login_errors','login_error_message'); function login_error_message($error){ //check if that's the error you are looking for $pos = strpos($error, 'incorrect'); if (is_int($pos)) { //its the right error so you can overwrite it $error = "Gebruikersnaam/wachtwoord klopt niet. <p>Tip1: Gebruikersnaam is niet hoofdlettergevoelig</p> <p>Tip2: Gebruik emailadres als gebruikersnaam</p> <p>Tip3: Verwijder browsergeschiedenis</p> <p>Tip4: Kies hieronder voor 'wachtwoord vergeten'</p>"; } return $error; }July 2, 2019 at 7:59 am #216516loganMemberSparky :) add this code in your customizer plugin. function my_custom_login_label( $translated_text, $text, $domain ) { if (in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) )) { if ($translated_text === 'Username or Email Address') $translated_text = 'YOUR TEXT'; if ($translated_text === 'Password') $translated_text = 'YOUR TEXT'; if ($translated_text === 'Register') $translated_text = 'YOUR TEXT'; if ($translated_text === 'Remember Me') $translated_text = 'YOUR TEXT'; if ($translated_text === 'Lost your password?') $translated_text = 'YOUR TEXT'; return $translated_text; } } add_filter( 'gettext', 'my_custom_login_label', 20, 3 ); refer: http://prntscr.com/o9ern0July 2, 2019 at 9:00 am #216525MeesterGijsSpectatorThe code conflicts with the customizer.php code in line 166: add_action( 'bbp_template_redirect', 'action_bbp_template_redirect'); This is the message that I get: Jouw PHP-wijzigingen zijn teruggedraaid vanwege een fout op regel 166 in het bestand wp-content/plugins/js_composer/include/classes/core/class-wpb-map.php. Repareer en probeer opnieuw. Uncaught Exception in wp-content/plugins/js_composer/include/classes/core/class-wpb-map.php:166 Stack trace: #0 wp-content/plugins/js_composer/include/helpers/helpers_api.php(40): WPBMap::map('rev_slider', Array) #1 wp-content/plugins/revslider/includes/tinybox.class.php(89): vc_map(Array) #2 wp-includes/class-wp-hook.php(286): RevSliderTinyBox::add_to_VC('') #3 wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #4 wp-includes/plugin.php(465): WP_Hook->do_action(Array) #5 wp-settings.php(525): do_action('init') #6 wp-config.php(93): require_once('/home/public/si...') #7 wp-load.php(37): require_once('/home/public/si...') #8 /home/public/sites/www.meesteJuly 2, 2019 at 11:43 am #216552loganMemberTry this one: function my_custom_login_label( $translated_text, $text, $domain ) { if (in_array( $GLOBALS['pagenow'], array('wp-login.php') )) { if ($translated_text === 'Username or Email Address') $translated_text = 'YOUR 1'; if ($translated_text === 'Password') $translated_text = 'YOUR 2'; if ($translated_text === 'Register') $translated_text = 'YOUR 3'; if ($translated_text === 'Remember Me') $translated_text = 'YOUR 4'; if ($translated_text === 'Lost your password?') $translated_text = 'YOUR 5'; } return $translated_text; } add_filter( 'gettext', 'my_custom_login_label', 99999, 3 );July 2, 2019 at 12:45 pm #216565MeesterGijsSpectatorNo it doesn't give an error when adding to customizer.php, but it doesn't translate the strings..
-
AuthorPosts
- The topic ‘change one word’ is closed to new replies.