• Resolved edurivera

    (@edurivera)


    Hello, I have added a button in one of Learndash sections, the button has the legend “START COURSE”, this website is also in Spanish, so I want to translate that new button to “COMENZAR CURSO”

    I try to do it through Loco Translate, but the string for the new button does not exist. What are the correct steps to do this? Thanks in advance for the help!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Tim W

    (@timwhitlock)

    You add a new string to a .po file by syncing it to a .pot file. See the manual on templates: https://localise.biz/wordpress/plugin/manual/templates

    I don’t know if this refers to a plugin or a theme, but if you add new source strings you have to sync the POT file to the code in order to pick up the new string. Then you can sync your PO files to that.

    I don’t know what it means to add a button to one of Learndash sections, but generally speaking it’s a bad idea to add anything to an existing text domain that is managed by a theme or plugin that is developed by someone else.

    In the case of themes it would be advisable to add the new string into a child theme. There is a section on that in my guide here: https://localise.biz/wordpress/plugin/child-themes#addition

    In the case of plugins, there isn’t a standard way to add extra strings. I would suggest they are added via your own plugin and to use filters in order to affect the content of the original plugin, but without knowing a lot of detail about what you’re doing it’s not possible to say if this is relevant or practical.

    If adding this button is part of some customising functionality of your theme/plugin then you should ask the author how to go about making added text translatable.

    Thread Starter edurivera

    (@edurivera)

    Hello Tim,

    Thank you for your response, it helped a lot!! In the end I was able to add the new string when I synced the po. and POT. I also added the _e() to the text so it could easily find the new string and it worked very well!!

    Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add a new string to .po file’ is closed to new replies.