There are “printf” statements all over the BuddyPress default theme. What do they mean?
Today, I decided to invest an hour into finding the answer to that question. Here is my answer.
In short, “printf” is php code used to help make themes display words and phrases from other languages. For a long answer and how-to, read this.
Here’s an example, in the BuddyPress default theme’s footer.php file, you will find the following line of code:
printf( __( '%s is proudly powered by WordPress and BuddyPress', 'buddypress' ), bloginfo('name') );
If you look at line #2963 in “buddypress –> bp-languages –> buddypress.pot”, you will see the same code as above.
Basically, these printf statements give us a central location to change certain “special” words and phrases across a BuddyPress website. For example, you might want to change all instances of “Login” to a different word (or language). You might want to change “Groups” to “Communities”, as the Custom Groups Name plugin does.
I am a beginner at this printf stuff, and that is as simple an answer as I can give right now. All you .pot and .mo gurus out there, please let me know if I misspoke at all. 🙂
More posts from themightymo.com
Yesterday I discovered the new Fluency 2.0 plugin for WordPress 2.7. It does a fantastic job of cleaning up the admin interface and makes the back-end WordPress experience much better for users.
We have just teamed up with one of the web’s finest search engine optimization gurus, Greg Cryns, and will now be offering his services to you, our customers! For you, our customer, this means that we now have added expertise in driving targeted traffic to your website. Greg has over a decade worth of search…
Below are my notes from tonight’s FlashMN meeting starring Dustin Tauer. The presentation focused on the new features of Adobe Creative Suite 4. Illustrator CS4 Can create multiple art boards. So, if I wanted to use artwork for the front and back of t-shirt, I would create 2 art boards (up to 100). There are…