0

Does a theme's text domain have to be the actual theme name?

If you develop WP themes, couldn't you just use the same name (perhaps your business name) for all the theme's you develop, making it easier to copy and paste code as you develop? (even though a find and replace is rather simple).

1 Answer 1

4

The text domain is a unique identifier, which makes sure WordPress can distinguish between all loaded translations so Using the basename of your plugin/theme is always a good choice because plugin/theme basename is always unique though it is not mandatory to have plugin/theme basename as text domain, you can use any unique identifier.

If you're translating a plugin or a theme, you'll need to use a text domain to denote all text belonging to that plugin/theme. This increases portability and plays better with already-existing WordPress tools.

In general, an application may use more than one large logical translatable module and a different MO file accordingly. A domain is a handle of each module, which has a different MO file so you should not use same text domain for different theme/plugin instead it should be unique for every plugin/theme.

You can get more information from this page.

1
  • Nice explanation, I'll play it safe and use a unique one for each theme
    – Andrew
    Commented Mar 28, 2013 at 4:57

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.