简体   繁体   中英

Dynamic content using .PO file

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM