WordPress theme name inside theme php files, what is the purpose of this?

I’ve been building basic themes now for nearly a year, and I’m trying to clean up my style as much as possible. But I don’t know where to look to find out what this does…

In the kubrick theme php files, for example you get a php tag like this…

Read More
<?php the_content('<p class="serif">' . __('Read the rest of this entry &raquo;', 'kubrick') . '</p>'); ?>

You see the theme name ‘kubrick‘ weaved in. What is the purpose of this?

You see it in all themes, twentyten, twentyeleven, etc.. but I never notice a difference if I leave it the same. What benefits does this have if I change it to my current theme name?

Can anyone enlighten me? or point me in the right direction?

Thanks
Josh

Related posts

Leave a Reply

1 comment

  1. This is the ‘theme text domain’ and is typically used for localization. You can find out more by reading the gettext filter reference. One note is that the text domain is not required to be the same as your theme name. You can make it whatever you want as long as you are consistent with what you load using load_theme_textdomain. It’s just convention to make it the same as your theme name. Finally, as to why you should bother including a domain here is a quote from an article called How to localize WordPress themes and plugins with GetText:

    Have you noticed the 2nd argument in the GetText calls? It’s an
    optional argument that tells GetText what the scope (domain) of the
    texts is. If supplied, this GetText will return the translations only
    from the dictionary that you supply with that domain name. Although
    optional, specifying the translation domain is highly recommended.
    Without it, GetText might return a different translation, if the same
    string also appears in a different plugin, or in WordPress.