Home › Forums › Legacy Support › Support queries › Other issues › Change '1 seats left' to '1 seat left'
- This topic has 37 replies, 4 voices, and was last updated 3 years, 11 months ago by fdittmar.
-
AuthorPosts
-
November 29, 2019 at 2:34 pm #235247fdittmarParticipantThis reply has been marked as private.November 30, 2019 at 7:16 am #235299Anshuman SahuKeymasterplease try adding this given code in your wplms-customizer.php file in wplms customizer plugin : add_filter('gettext', function ($translated_text, $untranslated_text, $domain) { if (strtolower($translated_text) == '1 seats left' ) { return '1 Seat Left'; } return $translated_text; }, 20, 3);November 30, 2019 at 2:21 pm #235385fdittmarParticipantHi, thanks. I can do that but that's not an efficient way to fix something that should be fixed in the base code (and is marked as a fixed bug in Trello). Will it find it's way to the theme updates properly? thanksNovember 30, 2019 at 2:55 pm #235386fdittmarParticipantAbove code in customizer does not work for me. @MK And, btw, it's also wrong again for the 0 count (shows 0 seat left) This should be fixed properly in function custom_vibe_course_button_students_extra in themes/wplms/includes/func.phpDecember 2, 2019 at 7:03 am #235462loganMemberHello,
add_filter('gettext', 'ps_remove_seat_left_string', 20, 3);
function ps_remove_seat_left_string($translated_text, $untranslated_text, $domain) {
} translate the string as per your requirement. this is the only way to fix this, refer: https://developer.wordpress.org/reference/hooks/gettext/
if ( $untranslated_text == '0 SEAT LEFT') {
return 'BRO YOU ARE A PRO.';
}
return $translated_text;December 4, 2019 at 1:45 am #235743fdittmarParticipantThis reply has been marked as private.December 4, 2019 at 1:48 pm #235832loganMemberyes we will add it as a bug . But what about this string? 0 seat left isnt it correct?December 4, 2019 at 2:20 pm #235835fdittmarParticipantIt was https://trello.com/c/5JRHWgBY And it was fixed for me / everyone. No, that is not correct in English. Everything is Seats other than the number 1 where it is Seat. So, for 0 it is 0 Seats LeftDecember 5, 2019 at 6:13 am #235894loganMemberHello, this is a string coming from theme: http://prntscr.com/q6fgjp either goto this file and change it but it will be gone after update. i suggest you to use the loco translate plugin to translate this string and this will remain forever even if you update the theme files.
if you do not know how to do this, in that share your admin credentials with course url where 0 seat left is appearing. I will fix this.December 5, 2019 at 5:41 pm #235973fdittmarParticipantHi, Using Loco to change something that's wrong in the theme seems the wrong approach. Isn't the answer to change func.php to include a 0 check?: if(isset($max_students) && $max_students && $max_students < 9998){ $number=bp_course_count_students_pursuing($course_id); $left = $max_students-$number; ---NEW CHECK - IF count 0 then do SEATS Left--- if($left <= 1) { $extra .= ''.($left).' '.('SEAT LEFT','vibe').''; } else { $extra .= ''.($left).' '.('SEATS LEFT','vibe').''; } } return $extra;December 5, 2019 at 5:46 pm #235974fdittmarParticipantThis reply has been marked as private.December 6, 2019 at 10:14 am #236026loganMemberHello, in codex = is assignment operator. it assigns value for example A = 1; for the comparison use ==. it checks the if A value is equal to 1 or not.
i think above codex gave you a glimpse of your issue. it is checked with 1, it is less or equal to one. in that case SEAT, LEFT appears. simply change the string, don't change in the codex. else after the update, it will be gone.
share ftp credentials so that i can make the changes in code. please identify which strings i should use.December 6, 2019 at 1:11 pm #236053fdittmarParticipantThis reply has been marked as private.December 7, 2019 at 7:22 am #236104Anshuman SahuKeymasterWell there are multiple occurences of this string and we have to do this smartly . We have added this in issue log and will fix it in next update of theme and its plugins .January 4, 2020 at 10:41 am #238336fdittmarParticipantI hope this makes it in the next version. It is a little embarrassing to run a learning and training website that has such an obvious language error visible to all visitors... thanks -
AuthorPosts
- The topic ‘Change '1 seats left' to '1 seat left'’ is closed to new replies.