• Resolved Carmdq

    (@carmdq)


    I want to insert a title in my theme and make that title localizable. I DO know how to add the string in the POT file.
    What I do NOT now is how to declare the text in my .php file to indicate it should be localized. That means, how to write the code.

    I’m trying to literally use <?php $translated_text = __( ‘text’, ‘domain’ ); ?>

    but that didn’t work. Do I have to create a new function or something?

    I appreciate a simple explanation since I’m totally new to php and localization.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • What you are doing is correct. Are you sure you have the right text domain name? What are you using to create the .po/.pot file?

    Thread Starter Carmdq

    (@carmdq)

    I wrapped it in <h> tags after finding this and it’s working now. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Localize text’ is closed to new replies.