Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1127027
    Indiespect
    Participant

    Hi

    I realised today that my language file isn’t active anymore. I created one for German (de_DE) which worked perfectly fine. Do you know of any changes that I have to update to get my translations back.

    When I look up the language with the Google Chrome Developper Tool it’s marked as de-DE instead of de_DE.
    May this be the mistake? And if yes where am I able to change that.

    Best, Christian

    URL: http://www.indiespect.ch
    Wordpress version: 4.5.3

    #1127201
    Lely
    Moderator

    Hi Christian,

    Would you mind giving us information on what happened before the language file stop working? Please also provide us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1128541
    Indiespect
    Participant
    This reply has been marked as private.
    #1128844
    Darshana
    Moderator
    This reply has been marked as private.
    #1129255
    Indiespect
    Participant
    This reply has been marked as private.
    #1129669
    Rue Nel
    Moderator

    Hello There,

    Thanks for the updates! What have you checked in Dev Tools is the output of the language_attributes() function. You can check out more about it from the codex:
    https://codex.wordpress.org/Function_Reference/language_attributes

    The one being used in the language filename should be like this:

    __x__-de_DE.po
    __x__-de_DE.mo
    __x__-en_GB.po
    __x__-en_GB.mo

    And by the way, the given credentials is still not working for us.

    For more translation details, please check out our knowledge base:
    https://community.theme.co/kb/translation/

    Hope this helps.

    #1131717
    Indiespect
    Participant

    Hello!

    Thank you for the information from the knowledge base.
    The instruction how to install the translation file in the child theme has worked perfectly fine for me.

    Best, Christian

    #1131739
    Indiespect
    Participant

    Sorry, but I just realised that it didn’t change everything. Or that some texts I can’t translate with this language file in poedit. Where am I able to change the text when I want to use the search function?

    Right now it says: “Type and press ‘enter’ to search” and after that it says “search results”. I can’t remember that it was like this before.

    Thanks for your help.

    #1132653
    Rad
    Moderator

    Hi there,

    Not sure what you mean by that, would you mind providing a video recording? And which string? It could be static.

    Thanks!

    #1133157
    Indiespect
    Participant

    Hi there,

    I tried to film the screen and upload it. I hope this works: http://sendvid.com/7a9l23uo

    Do you see what I mean? For parts of my website it uses my translation and for others it doesn’t.
    Also for the comment function at the end of every post.

    Best, Christian

    #1133423
    Lely
    Moderator

    Hello Christian,

    Thank you for the video.
    To translate those text, please add the following code on your child theme’s functions.php file:

    add_filter('gettext', 'translate_text' );
    function translate_text($translated) { 
     $translated = str_ireplace('Type and Press “enter” to Search', "Type and Press “enter” to Search Translation", $translated);
      $translated = str_ireplace('Search Results', "Search Results Translation", $translated);
      return $translated; 
    }
    

    Update Type and Press “enter” to Search Translation and Search Results Translation to proper translation.

    Hope this helps.

    #1133484
    Indiespect
    Participant

    Thank you, that worked. But do I have to add a translation for every single text to that function?
    If somebody looks for a keyword that doesn’t exist, the message is also in English:

    NOTHING TO SHOW RIGHT NOW
    It appears whatever you were looking for is no longer here or perhaps wasn’t here to begin with. You might want to try starting over from the homepage to see if you can find what you’re after from there.

    And also the comment section after every post is in English. Isn’t there a way to translate those text in PoEdit or somewhere similar?

    Best, Christian

    #1134294
    Rad
    Moderator

    Hi there,

    They should be translatable within PoEdit, you may add strings if not available and translate them. Example, that section is available here wp-content\themes\x\framework\views\global\_content-none.php

    <article id="post-0" class="post-0 post type-post status-publish hentry">
      <div class="entry-wrap">
        <header class="entry-header">
          <h1 class="entry-title"><?php _e( 'Nothing to Show Right Now', '__x__' ); ?></h1>
        </header>
        <div class="entry-content">
          <p><?php _e( "It appears whatever you were looking for is no longer here or perhaps wasn't here to begin with. You might want to try starting over from the homepage to see if you can find what you're after from there.", '__x__' ); ?></p>
        </div>
      </div>
    </article> <!-- end #post-0 -->

    The string is outputted by _e() https://codex.wordpress.org/Function_Reference/_e which makes it translatable.

    Yes, those strings in the comment section are translatable too. If you can’t find those string then please add them then translate it.

    Thanks!

    #1134941
    Indiespect
    Participant

    Okay, it worked to add new strings to PoEdit and translate them. But not for the strings in the comment section.
    But it’s really strange since all those texts used to be in German a few weeks ago. Was there an update or something that changed the handling of the language?

    I have to look through the whole website to find English text phrases. And most of it isn’t in the language file itself…
    There is no way to insert standard German translations for all those sentences?

    #1135872
    Rad
    Moderator

    Hi there,

    It shouldn’t change, the comment section is part of WordPress and we only did some styling to make it blend with the theme. This might help https://wpml.org/forums/topic/translate-placeholder-comments-text/ and can be customized here \wp-content\themes\x\framework\views\integrity\wp-comments.php

    One language should represent one language only, you can’t mix English and German base string.

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1127027 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>