WordPress.org

Ready to get started?Download WordPress

Forums

WP-Ajaxify-Comments
WPML translation (custom messages) (9 posts)

  1. MI
    Member
    Posted 5 months ago #

    How can I translate messages? Can see some of the strings in WPML string management tool, but after adding translation it doesn't seems to be working. Also tried to "replace" the string with getText and to translate it as theme part using this function:

    function my_text_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
    case '<strong>ERROR</strong>: please type a comment.' :
    $translated_text = __( 'CUSTOM TEXT', 'THEME NAME' );
    break;
    
    }
    return $translated_text;
    
    }
    add_filter( 'gettext', 'my_text_strings', 20, 3 );

    It replaced default text, but after translating it over WMPL it is still in one language.

    Also i have tried to change default strings in wp-ajaxify-comments.php (in line 37 and line 246), but it didn't changed from default text.

    Any help?

    Thanks!

    https://wordpress.org/plugins/wp-ajaxify-comments/

  2. janjonas
    Member
    Plugin Author

    Posted 5 months ago #

    I will try to find a way to add compatibility to WPML...

  3. MI
    Member
    Posted 5 months ago #

    Actually just checked out that some of the strings i can translate over WPML, but not all (f.e. please type a comment). i think it could be because you are using default WP messages?

  4. janjonas
    Member
    Plugin Author

    Posted 5 months ago #

    Can you or can you not edit the translation for "please type a comment" using WPML?

    Unfortunately WPML seems to be a none-free plugin. Could you send me the source code a can try to find out how to add compatibility.
    And yes: My plugin uses some default WordPress texts and some custom text.

  5. MI
    Member
    Posted 5 months ago #

    Thanks for reply.

    No, I can't. F.e. i can translate "Posting your comment" over WPML, but can't translate "please type a comment". WPML is working very simple - this plugin is searching for all available translations (like __() ) in plugin and gives the ability to translate it. WPML also found "please type a comment", but when i'm trying to translate it - it still shows the same text. Again i think it is because some of text (as you confirmed too) are using WordPress texts and the solution would be to use separate texts.

  6. janjonas
    Member
    Plugin Author

    Posted 4 months ago #

    Thanks for the explanation.
    You are right: The plugin uses some default WordPress texts, like "please type a comment". Isn't it possible to customize those default texts using WPML?

  7. MI
    Member
    Posted 4 months ago #

    I think it is possible. However it is quite hard, because i think WP uses .mo files and i'm translating everything using plugin string translation module. However i think it would be much better to have those WP messages assigned to Ajaxify plugin (just duplicating them, but giving ability to translate it for ajaxify not for wp). When you'll be able to translate everything really easy. It looked as bug for me when i tried first to translate phrase "please type a comment" and it didn't changed.

  8. janjonas
    Member
    Plugin Author

    Posted 4 months ago #

    I think I understand the problem, but I need a copy of the WPML code to see how it works in detail and to make sure everything is 100% compatible to WordPress environments that uses WPML and those that do not use WPML. Please contact me here http://blog.janjonas.net/contact.

    Thanks
    Jan

  9. janjonas
    Member
    Plugin Author

    Posted 3 months ago #

    Hi Mario,

    the WPML team created a test page for me and I was able to translate the error messages using the (default) WPML string translation functionality. Could you please send me a link to your page because a need to see the URL structure of your page to since one need to add a workaround similar to this one http://wpml.org/forums/topic/cant-translate-error-message-of-wp-comments-post-php/ except that you do not need to add PHP code but you can use the options of my plugin.

    Best regards,
    Jan

Reply

You must log in to post.

About this Plugin

About this Topic