5

At the moment i am translating a WP theme with the __( and _e( functions and poedit. Now for words and sentences it works ok, but i don't know what to do with 'hardcoded' body text in the theme?

Can i just do something like:

    __('WordPress is web software you can use to create a beautiful website or blog. We like to say that WordPress is both free and priceless at the same time.
The core software is built by hundreds of community volunteers, and when you’re ready for more there are thousands of plugins and themes available to transform your site into almost anything you can imagine. Over 60 million people have chosen WordPress to power the place on the web they call “home” — we’d love you to join the family.','my-theme');

Is there a maximum size function __( and poedit can handle???

regards

1 Answer 1

6

I cannot find the reference for hard answer on this, but likely it can handle large strings just fine. From quick look at WP's own files somethings like this:

__('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.')

is stored as multiple lines in PO:

#: wp-activate.php:96
msgid ""
"Your account has been activated. You may now <a href=\"%1$s\">log in</a> to "
"the site using your chosen username of &#8220;%2$s&#8221;. Please check your "
"email inbox at %3$s for your password and login instructions. If you do not "
"receive an email, please check your junk or spam folder. If you still do not "
"receive an email within an hour, you can <a href=\"%4$s\">reset your "
"password</a>."

So it seems inherently aware and suitable for handling large strings.

2
  • Thank you Rarst, i am going to use large strings then. BTW i notice something strange which to me 1 hour to notice. POedit doesn't seem to like characters: é, because i get an error. Replacing the é with just a regular e i can update the poedit file again and go translate. Does this sound familar with POedit?
    – alex
    Commented Jan 9, 2015 at 9:29
  • 1
    @alex would be best to contact its developer about it, I wouldn't think the software made for translations would have character issues.
    – Rarst
    Commented Jan 9, 2015 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.