WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
[resolved] Add custom string translation on Polylang, working with Responsive theme (17 posts)

  1. BenCaps
    Member
    Posted 2 years ago #

    Hi there,
    I’m new in wordpress, and have to set up a website my internship. I’m currently using Polylang on Responsive theme (http://themeid.com/). All is fine except that I don’t know how to translate some features of Responsive home page theme. With Polylang string translation, we’re able to translate site title, tag line and widget title, but I also would like to change those stuff which are part of Responsive theme : home_headline, home_subheadline, home_content_area, cta_text, cta_url.
    I just start to understand how .css and .php work, but for my problem, I don’t know whether I have to edit Polylang plugin or Responsive theme files.
    I already read those posts but it made me even more confused
    http://wordpress.org/support/topic/plugin-polylang-multilingual-theme-options
    http://wordpress.org/support/topic/polylang-and-wordpress-seo-string-translation
    http://themeid.com/forum/post/5018/#p5018
    This is my wordpress now so you can easily know what i’m talking about
    http://188.165.253.110:8080/knowledgebase/
    Thanks for your help

    http://wordpress.org/extend/plugins/polylang/

  2. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

    No need for modifying one of them. Just create a new PHP file in your plugins directory and copy paste this:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

  3. BenCaps
    Member
    Posted 2 years ago #

    Thanks for your fast reply.
    However i think i made it wrong because nothing change in my polylang settings. I just have some strange display on my page and admin interface?

    Could it be just a mishandling or mistake of copy/paste?

  4. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

    I tested the code before so it should work. I repasted it on pastebin. Hopefully it will work this time. http://pastebin.com/0Aw0wDaD

  5. nawras
    Member
    Posted 1 year ago #

    hi Chouby,

    i think i'm having the same issue ,, i'm trying to add more translation string to the Polylang plugin since there is only 4 [Site Title,Tagline ,Widget title ,Widget title ] and there is still some string in the page like [read more ..] needs to be translated, also i did not get your answer about adding a php file and what to past in it,, can you explain more ,, thanks

  6. Benji007
    Member
    Posted 1 year ago #

    nawras, still looking for an answer?

    I think I got this figured out :-)

  7. yeuxbleus.eu
    Member
    Posted 1 year ago #

    Hi Chouby, I dont get this figured out. After adding the file, in Languages Strings I can add translations of the home_headline', 'home_subheadline', but not of 'home_content_area'. That does not appear. Should it or am I looking at the wrong place to add translation of the home content area?

    using Responsive Child theme, polylang Version 0.9.4 and additional plugin as above. root-cause-analysis.yeuxbleus.eu

  8. yeuxbleus.eu
    Member
    Posted 1 year ago #


  9. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    I remade the test and it works. It is important to put some content in the theme option. If you leave it empty, it will not appear in the translations list table

  10. yeuxbleus.eu
    Member
    Posted 1 year ago #

    thanks Chouby.

    There must be some other conditions I am not following then. (relatively new with this)

    I have copied the pasted code in a file (adjusted 'my setting' to Polylang Homepage) (called it polylang-homepage.php) and uploaded to a folder (polylang-homepage) in the plugins folder of the Responsive Theme.

    Activated the plugin in the child theme.

    For polylang itself two EN-US and NL are added as languages.

    I have activated all other plugins.

    headline, subheadline and content area at the theme options are filled in as you can recognize at http://root-cause-analysis.yeuxbleus.eu/

    none of these three are appearing at settings, languages, strings translations...

    what do I forget or what other conditions i have to keep into account?

  11. yeuxbleus.eu
    Member
    Posted 1 year ago #

    in above meant deactivated other plugins of course...

    anyone who can advise?

  12. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    After adding the file, in Languages Strings I can add translations of the home_headline', 'home_subheadline', but not of 'home_content_area'

    none of these three are appearing at settings, languages, strings translations...

    Have you the problem for all strings or only one?

    and uploaded to a folder (polylang-homepage) in the plugins folder of the Responsive Theme

    You mean the 'wp-content/plugins' directory or somewhere else ?

    Which version of the responsive theme are you using?

  13. yeuxbleus.eu
    Member
    Posted 1 year ago #

    all three strings do not appear at settings, languages, strings translations... (in my first message i confused with site title and tag line)

    yes in de wp-content/plugins directory

    version 1.8.1 Responsive by ThemeID

  14. yeuxbleus.eu
    Member
    Posted 1 year ago #

    https://www.dropbox.com/sh/qxkkjwcdlv4jx27/7hB9w_aiXj

    I have put some screenshots, showing theme, fact that there is both content EN/NL in pages and posts and the translations strings overview. (child theme has unfortunate name Twenty Eleven Child, but is a responsive child...)

  15. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    I finally found the issue. Due to the fact that you changed the file name and directory, the code was called before Polylang when it should have been called after.

    I modified the code to suppress this issue, so it should work now (whatever the name of the file and directory)
    http://pastebin.com/0Aw0wDaD

  16. yeuxbleus.eu
    Member
    Posted 1 year ago #

    thanks very much Chouby! works fine.

  17. nawras
    Member
    Posted 1 year ago #

    hi,

    yes actually still looking for answer ,, since i did not got the answer for my previous question and also the same happens to me when i tried to translate the Site Title and the Tagline when i switch the the other language it still showing in English also i add the translate in the strings translation tab
    thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags