WordPress.org

Ready to get started?Download WordPress

Forums

GD bbPress Attachments
Trabslation of "Sorry, this file type is not permitted for security reasons" (10 posts)

  1. Rasheed Bydousi
    Member
    Posted 1 year ago #

    I can't find this term "Sorry, this file type is not permitted for security reasons" in gd-bbpress-attachments.pot file.

    I assume it pulls the term from here.

    However, although the term is already translated it still appears in English.

    Any thoughts?

    Thanks

    http://wordpress.org/extend/plugins/gd-bbpress-attachments/

  2. Milan Petrovic
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, that is strange. Plugin gets this error from WP, so it should be translated. I will check.

  3. Rasheed Bydousi
    Member
    Posted 1 year ago #

    Great.
    Thanks.

  4. Rasheed Bydousi
    Member
    Posted 1 year ago #

    Hello again,

    I see that the problem still exists even after I updated everything.

    Thanks

  5. Milan Petrovic
    Member
    Plugin Author

    Posted 1 year ago #

    Plugin is not doing anything with this, this must be translated in WP language file.

  6. Nashwan Doaqan
    Member
    Posted 1 year ago #

    @Milan Petrovic actually the plugin have some control on this problem , as you see the sentence "Sorry, this file type is not permitted for security reasons" is added in admin.mo file , so It can't be translated in the front-end of the site .

    I have a simple idea It can be improve your plugin l10n strategy , You can add a tricky text-domain to all WordPress l10n functions like __() , _e() ... etc , and have some config option to load the translation from the WordPress or from plugin translation files .. Confuse ?!

    Let's Talk By Code ..

    <?php
    
    define ( "LOAD_L10N_FROM_WP" , false ); 
    
    add_filter ( 'gettext' , "AW_get_translation" , 1 , 3 );
    
    function AW_get_translation ( $translation , $text, $domain ) {
    
        if ( $domain == "maybe-wp" ) {
    
            if ( LOAD_L10N_FROM_WP == false ) {
                 $translation = __( $text , "plugin-text-domain" );
            } else {
                 $translation = __( $text );
            }
    
        } // end if
    
        return $translation;
    
    } // end AW_get_translation()
    
    _e( "Hello World" , "maybe-wp" );
    
    ?>

    Note: I write my code on the fly ( No Testing ) so you can improve it or using other strategy , After all it just an idea :)

  7. Nashwan Doaqan
    Member
    Posted 1 year ago #

    Another way to write the code above :

    <?php
    
    define ( "LOAD_L10N_FROM_WP" , false ); 
    
    function AW_get_maybe_textdomain () {
       return ( !LOAD_L10N_FROM_WP ) ? "plugin-text-domain" : "";
    }
    
    _e( "Hello World" , AW_get_maybe_textdomain() );
    
    ?>
  8. Milan Petrovic
    Member
    Plugin Author

    Posted 1 year ago #

    This is not good solution for one string. I will try to find some other way to solve this.

  9. Nashwan Doaqan
    Member
    Posted 1 year ago #

    This is not good solution for one string. I will try to find some other way to solve this.

    Sure Thing , It may be a very good solution if you rely on many WordPress translation strings , anyway you know what your plugin needs :)

  10. Nashwan Doaqan
    Member
    Posted 1 year ago #

    Started 2 months and it's not resolved yet !

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.