0

I have a Wordpress site that has support for other languages using the gettext system.

I am curious if I can call content dynamically, let's say from function the_content():

printf( __( '%s', 'my-theme' ), the_content() );

I'm guessing this is only possible if I provide the entire string in a .po file, which would obviously be in-efficient, not to mention that content would always be changing.

But I CAN do this, correct?

Raptor
  • 53,206
  • 45
  • 230
  • 366
Rob Myrick
  • 859
  • 11
  • 28

1 Answers1

0

Since the_content() should be the content of a Post or a Page, you can install WordPress plugin like qTranslate, zTranslate or equiv. to provide multi-language contents.

Translation via .po file is only recommend for static contents, like menu items, static links, etc.

Raptor
  • 53,206
  • 45
  • 230
  • 366
  • Thanks @Raptor, I actually am aware of all the plugins to do this, I was really more interested in whether it could actually be done, just for peace or mind after days of frustration :) – Rob Myrick Sep 17 '14 at 01:59
  • Though index keys of `.po` file should be static contents, technically it could be done. – Raptor Sep 17 '14 at 02:29
  • and the way I would do this is to use `%s` as the index in `POEDIT`, and then I would use entire content from the text editor (i.e. `the_content()`) as the actual translated string? Is this technically now it could be done? – Rob Myrick Sep 17 '14 at 02:33
  • No you can't do this with POEDIT – Raptor Sep 17 '14 at 02:45