Change '1 seats left' to '1 seat left'

Home Forums Legacy Support Support queries Other issues Change '1 seats left' to '1 seat left'

Viewing 15 posts - 16 through 30 (of 38 total)
  • Author
    Posts
  • #235247
    fdittmar
    Participant
    This reply has been marked as private.
    #235299
    Anshuman Sahu
    Keymaster
    please 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);  
    #235385
    fdittmar
    Participant
    Hi, 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? thanks
    #235386
    fdittmar
    Participant
    Above 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.php
    #235462
    logan
    Member
    Hello,

    add_filter('gettext', 'ps_remove_seat_left_string', 20, 3);

    function ps_remove_seat_left_string($translated_text, $untranslated_text, $domain) {
    if ( $untranslated_text == '0 SEAT LEFT') {
    return 'BRO YOU ARE A PRO.';
    }
    return $translated_text;

    } translate the string as per your requirement. this is the only way to fix this, refer: https://developer.wordpress.org/reference/hooks/gettext/
    #235743
    fdittmar
    Participant
    This reply has been marked as private.
    #235832
    logan
    Member
    yes we will add it as a bug . But what about this string? 0 seat left isnt it correct?
    #235835
    fdittmar
    Participant
    It 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 Left
    #235894
    logan
    Member
    Hello, 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.  
    #235973
    fdittmar
    Participant
    Hi, 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;
    #235974
    fdittmar
    Participant
    This reply has been marked as private.
    #236026
    logan
    Member
    Hello, 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.
    #236053
    fdittmar
    Participant
    This reply has been marked as private.
    #236104
    Anshuman Sahu
    Keymaster
    Well 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 .  
    #238336
    fdittmar
    Participant
    I 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
Viewing 15 posts - 16 through 30 (of 38 total)
  • The topic ‘Change '1 seats left' to '1 seat left'’ is closed to new replies.