Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #367511

    Askeam
    Participant

    I read all the related forum threads on the subject of translation X into other languages, together with general advice on translating any theme from WordPress and I still can’t get it to work.

    I would like to get a step-by-step instructions from X Theme developers on how to deal with translation of X into other languages.

    X is advertised as translation ready and I successfully used “/wp-content/themes/x/frameworks/lang/x.pot” file to open it up in POEDIT, translate it and create two resulting files with “.PO” and “.MO” extensions.

    However, no matter what I do, I can’t get X Theme to recognize translation files.

    What have I tried?

    1. Adding generated .PO and .MO files to original theme’s location “/wp-content/themes/x/frameworks/lang/”. I know that they would be overwritten if the theme is updated, but I had to test them anyway. Did not work.
    2. Created a child theme and completed all the steps found in any other forum thread on this forum related to translation, modification of wp-config file etc. No luck.
    3. Played with all the possible combinations and locations/directories to put “.PO” and “.MO” files in. No luck ether.
    4. Verified that “.PO” and “.MO” files created by POEDIT are properly working by modifying existing translation files for WordPress located in “wp-content/languages/”. Worked like a charm. So, POEDIT is not a suspect.

    I am lost.

    Lets start form the top:

    Could you please post (or direct me to it, if i missed it) a step-by-step guide on how to translate X Theme into other languages (by using or not using a child theme) starting from your “/wp-content/themes/x/frameworks/lang/x.pot” file?

    p.s. This question is not about whether or not to use another commercial WPML plugin to translate X Theme, but rather, how to make X Theme to recognize existing “.PO” and “.MO” files properly created on the bases of your own “/wp-content/themes/x/frameworks/lang/x.pot” file.

    Looking forward to your answer.

    Thank you.

    #367525

    Zeshan
    Member

    Hi there,

    Thanks for writing in! First, to assist you with this, we’ll first need you to provide us with your URL as stated on the forum entrance page. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you.

    In the meantime, please make sure that you have set your language under Settings > General > Site Language . And you may also find this post helpful: https://community.theme.co//forums/topic/translating-with-codestyling-localization/#post-244851

    Thanks!

    #367740

    Askeam
    Participant
    This reply has been marked as private.
    #368639

    Zeshan
    Member

    Hi there,

    Thanks for your feedback! I’ll forward this to our developers for further investigation.

    In the meantime, you can translate these comments manually using jQuery. You can insert this code under Custom > JavaScript in the Customizer:

    // Translating Comments in Russian 
    // ================================
    
    jQuery(document).ready(function($) {
      $('.meta-comments').each(function() {
        $(this).text(function( index, text ) {
          var output = text;
          switch ( text ) {
    
            case '2 Комментария':
              output = '2 Translation';
              break;
            case '5 Комментария':
              output = '5 комментариев';
              break;
    
          }
    
          return output;
        });
      });
    });
    

    So, for example, replace 2 Translation with the translation for 2 Комментария. If you want to add translation for other comments number, you can duplicate this code:

    case '5 Комментария':
      output = '5 комментариев';
      break;
    

    And replace 5 Комментария with your targeted string and 5 комментариев with its translation.

    Hope this helps. 🙂

    Thank you.

    #371610

    baramagnus
    Participant

    I have the exact same problem and I have wasted so much time. Right now I’m working on a new install and I have the same problem.
    I do not want more and more special code for every time I need to translate a new string. I just want the .po/.mo files to work. I hope you can follow up this thread.

    Thanks!

    #371853

    Rue Nel
    Moderator

    Hello There,

    Thanks for updating this thread! Would you please provide us the url and access information of your site so we can take a closer look. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    To do this, you can make a post with the following info:
    – Link to your site

    – WordPress Admin username / password

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

    Thank you.

    #372005

    baramagnus
    Participant
    This reply has been marked as private.
    #372074

    Rue Nel
    Moderator

    Hello There,

    Thank you for the updates! We have disabled the email notifications on purpose. You just have to subscribe in the topics instead. You can then check your subscriptions here: https://community.theme.co//users/baramagnus/subscriptions/

    The tags keyword in in this file: _content-post-footer.php. Simply create a new file in your local machine and insert the following code:

    <?php
    
    // =============================================================================
    // VIEWS/RENEW/_CONTENT-POST-FOOTER.PHP
    // -----------------------------------------------------------------------------
    // Standard <footer> output for various posts.
    // =============================================================================
    
    ?>
    
    <?php if ( has_tag() ) : ?>
      <footer class="entry-footer cf">
        <?php echo get_the_tag_list( '<p><i class="x-icon-tags" data-x-icon=""></i> Tags: ', ', ', '</p>' ); ?>
      </footer>
    <?php endif; ?>

    You can edit the Tags keyword in the code and replace it with your translation. Saved this file as _content-post-footer.php and upload it to your server in your child theme’s folder wp-content/themes/x-child/framework/views/renew/.

    The share on keyword can be found in Cornerstone plugin. You have to translate the .po and .mo file of Cornerstone plugin as well. You can find the language translation file here: wp-content/plugins/cornerstone/lang/cornerstone.pot

    Hope this helps. Kindly let us know.

    #372086

    baramagnus
    Participant

    Hi, thanks for swift reply.

    I have translated the .pot in Cornerstone but it does not work. Tooltip text is still in English.

    Also, using code just to translate one single word is not a satisfying solution. What about all the other strings that I later discover that I need to translate? And what about reusing the file on other sites that I may build with X? Is it impossible to make the .po/.mo work properly?

    Thanks!

    Magnus

    #372128

    Rue Nel
    Moderator

    Hello Magnus,

    We will be reporting this to our developers to see to it that every keyword in the theme and in Cornerstone can be translated using the .pot file. Once they place a fixed for this issue, it will be updated and rolled out in our next update release.

    Please bear with us. Thank you for your understanding.

    #372130

    baramagnus
    Participant

    Thank you. That is a kind of answer that I like. Do you have a thread for suggestions for the theme? Your theme is so awesome that I would like it to be my preferred theme for new developments.

    #372186

    Zeshan
    Member

    You’re welcome! You can just pass your suggestions here and we’ll forward them to our developers for future consideration. 🙂

    And thank you for your kind words! 🙂

    #395587

    Havice D
    Participant

    Can you please post the instructions on how to get this to work with the child theme? If you do it behind the scenes for someone without posting the details, then people are going to continue to ask for this help. This appears to be a common request, perhaps adding a Knowledge Base article with the instructions would be helpful.

    #395668

    Rue Nel
    Moderator

    Hello There,

    Thanks for updating this thread!

    To translate your site, for example to French, follow the steps below:
    1] Using PoEdit, download and open the file x.pot (wp-content/themes/x/framework/lang/x.pot)
    2] Save the file as fr_FR.po. In the file fr_FR.po, it contains all the keywords present in X theme that needs to be translated to French. Add your translation and save it again.
    3] Upload the files fr_FR.po and fr_FR.mo to your child theme’s folder /wp-content/themes/x-child/framework/lang/

    For better results and avoid from being overwritten during updates, please rename this file __x__-fr_FR.po and __x__-fr_FR.mo. Place these files in these folder: (wp-content/languages/themes/)

    Hope this helps. Please let us know how it goes.

    #398272

    Havice D
    Participant

    Hi,

    Thanks for your response.

    The instructions above do not work. We only want to change certain words and phrases in the PO file. We’ve copied over the default.po file from x and made our edits. I’ve tried naming these files default.po and default.mo and even named them es_ES.po and es_ES.mo to match your instructions above (#2) and uploaded. Some threads have said to put these files in /x-child/framework/lang and others have said /x-child/framework/languages. I’ve tried both.

    I’ve tried option number 3 above, and although, the language file appeared in the languages drop down menu in the admin Settings, that didn’t work either.

    I feel like there’s some step missing here. Some other threads have said to add a snippet of code to your functions file to call the child theme language file and others to add some code to the wp_config.php file. This is why I’m asking for instructions here, so that I don’t have to piece together instructions from multiple threads. The instructions on this simply are not clear.

    I’m hoping you can provide a step by step list that includes everything needed to get language files to work with child themes.