WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: qTranslate] Page Title (23 posts)

  1. chris1354
    Member
    Posted 2 years ago #

    Hi,
    I have a problem with qTranslate. The title of each page is displayed in English and German. For example a title of one page is "About us", but you can see "About usÜber uns"

    I tried <!--:de-->Über uns<!--:--><!--:en-->About us<!--:-->
    and [:de]Über uns[:en]About us

    I think it depends on the theme but I don´t know how to fix it.
    http://www.futubox-reseller.com

  2. hiteshanjara
    Member
    Posted 2 years ago #

    Hey,

    You need to use "qtrans_use" function to display the post title as per current language.

    You can use the following code to display correct post title -

    <?php echo qtrans_use($q_config['language'], $post->post_title, true);?>

    Example link - http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=2

    Hope this will help you!

  3. chris1354
    Member
    Posted 2 years ago #

    Hi,
    Yes that helped me a lot. Thank you very much.

  4. hiteshanjara
    Member
    Posted 2 years ago #

    Yo welcome :)

  5. lull
    Member
    Posted 1 year ago #

    <?php echo qtrans_use($q_config['language'], $post->post_title, true);?>

    If I want to call the meta title post, from the "Qtranslate meta", how can I do ?
    thanks to help me

  6. hiteshanjara
    Member
    Posted 1 year ago #

    I think you can try this:

    First of all, get the meta data in to separate variable:

    $post_meta = get_post_meta($post->ID, 'meta_key', true)

    and then, you can translate it as we did:

    <?php echo qtrans_use($q_config['language'], $post_meta, true);?>

    Hope this will help you!

  7. lull
    Member
    Posted 1 year ago #

    Ok ! perfect, I try it.
    Thanks a lot !

  8. aspiandore
    Member
    Posted 1 year ago #

    @Huteshanjara: Please i read your great solution, but i don't have any ideas where place the code. My site (under construction) are http://www.boscaro.info and theme directory are boscaro2 . If you have a bit of time for me you are wellcome!

    Thanks in advance.

  9. hiteshanjara
    Member
    Posted 1 year ago #

    okay, how can i contact you?

    Can I contact you from your site: http://www.boscaro.info/en/contatti/

    let me know that what will be best to discuss it.

    Hitesh Anjara

  10. joomlamedia
    Member
    Posted 1 year ago #

    Hello
    I am having the same problem let me know in which file we have to change.

    thanks

  11. sibeesh
    Member
    Posted 1 year ago #

    hi hiteshanjara,
    i am new to wordpress as well as qTranslate. i read your solution for translating the post title, but still i dont know where do i need to add those code. Can you please help me. Thanks in advance

  12. hiteshanjara
    Member
    Posted 1 year ago #

    Hi, can u plz give your installed wordpress version?

  13. sibeesh
    Member
    Posted 1 year ago #

    hi hiteshanjara,

    i am using wordpress version 3.5.1

  14. hiteshanjara
    Member
    Posted 1 year ago #

    Okay

    You just need to find the "content-page.php" in your theme folder.

    For. E.g: "/wp-content/themes/YOUR_THEME_FOLDER/content-page.php"

    In this file, you can find the_title(); replace this code with:

    global $post;
    echo qtrans_use($q_config['language'], $post->post_title, true);

    as per my above comments.

    I hope this will work in your theme, let me know if you will face any issue on the same.

  15. sibeesh
    Member
    Posted 1 year ago #

    dude thanks a lot for your help.now i have added the code to the wp-content/themes/YOUR_THEME_FOLDER/content-page.php .but my doubt is if we add new posts or page,in the admin view of wordpress the every new page or posts title should be shown in the laguages which i have included na...(i included simplified chinese,traditional chinese,english)

    pleas check the image below
    http://prntscr.com/14d9uj

    (in that image you could find that title for traditional and simplified chinese is null)

  16. hiteshanjara
    Member
    Posted 1 year ago #

    ;) You should need to enter the translated text there.

  17. sibeesh
    Member
    Posted 1 year ago #

    you mean for every entry i should make entries like this na?

    please click this link
    http://prntscr.com/14dbvy

  18. hiteshanjara
    Member
    Posted 1 year ago #

    Of course you have to do this for every entry...

  19. sibeesh
    Member
    Posted 1 year ago #

    :( hmmm is there any other option? and i have one more issue in qTranslate

    There are two major versions of Chinese, traditional and simplified. It's common on multi-language sites to offer both forms, and so do I. Seeing that simplified is already installed by default (assuming the 中文 there is simplified since it has the PRC flag), I wanted to add traditional Chinese and got:

    "There is already a language with the same Language Code!"

    can i add traditional chinese?(Simplified Chinese is zh-CN, traditional Chinese is zh-HK or zh-TW)i added traditional chinese and i tried with TW for traditional but it is not getting translated..

  20. hiteshanjara
    Member
    Posted 1 year ago #

  21. sibeesh
    Member
    Posted 1 year ago #

    hiteshanjara thanks a lot.but i have already gone through this links but i could not find any solution for that..in qTranslate when we try to add traditional chinese with language code zh-TW it says that only two letters are acceptable..so i used simply TW and i could add that language successfully but no translation is happening.

  22. hiteshanjara
    Member
    Posted 1 year ago #

  23. sibeesh
    Member
    Posted 1 year ago #

    dude thank you for your reply..i will try that too...i will inform you after i test that

Topic Closed

This topic has been closed to new replies.

About this Topic