Support » Plugin: Theme Check » Text Domain Clarification

  • Resolved Jason Narciso

    (@jnarciso04)


    First off this plugin has been super helpful in debugging and standardizing some client themes.

    None are for public consumption, but I’m trying to wrap my head around the following warning I consistently get (I’ve made the text domains in question generic, but still applicable):

    Warning: More than one text-domain is being used in this theme. This means the theme will not be compatible with WordPress.org language packs.
    The domains found are client-name, default_starter

    I’ve changed any text domain info across the theme, but still get this warning. The only places where the original “default_starter” text domain remains are in some function calls. Every other place has been changed with the “client-name” to match the text domain defined style.css.

    Can you clarify where it may be looking and possibly still finding the original text domain? I don’t know what else to try.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Ulrich

    (@grapplerulrich)

    What is the code snippet where default_starter is used?

    Not sure I understand, but it WAS used throughout the default starter theme for text domain/name spacing purposes. But again, I’ve gone through and changed all of those instances to the new “client-name” text domain.

    The only places where that old default_starter text lives is in function/action names. That shouldn’t matter right?

    That is where I’m getting hung up. I’m not sure where it is still seeing it as registered when it’s only used in function/action names.

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    That code isn’t looking at your function or action names. It’s looking at the various localization function calls. Things like _e() or __() and so forth.

    So, if it’s telling you that, then it’s finding that. You missed one. Search again.

    No, I haven’t missed one. I’ve searched and replaced any instance of ‘client-name’ within all localization function calls. I’ve double and triple checked.

    That name ONLY lives in the function/action names. I understand now that the plugin shouldn’t/wouldn’t look there, so I’m not sure where the issue lies.

    Again, not a major issue as this won’t be publicly distributed but I’m just trying to be thorough.

    Thanks anyway for the suggestion.

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    @jnarciso04 Okay, let me try and clarify.

    The check that is running on this is located here:

    https://plugins.svn.wordpress.org/theme-check/trunk/checks/textdomain.php

    It is literally parsing the code and then looking for all the function calls relating to the localization. So yes, in this case, it is reading your code and finding the text domains.

    If it says you’re using “default_starter” as a text domain, then that is because it found somewhere, in your code, where you’re using “default_starter” as a text domain.

    So yes, you missed one. Look again. It’s not wrong. It can’t make things up. It’s just code. 🙂

    I’ve searched through my entire project for ‘default_starter’ as it would be displayed in a localization call. And verified those have been changed.

    I’ve also searched for 2 localization functions starting with __( and _e. I’ve verified those have changed as well.

    I looked through your textdomain.php file array and searched through those localization functions and even cross referenced what the codex has as well here: https://codex.wordpress.org/L10n

    All of those have been verified and changed if they existed.

    Do you have an idea of where else this possibly could be looking? I would think a search for my text domain alone would suffice. I’d be happy to send you my theme files if you wanted to take a look yourself. I’m trying to learn this and be as thorough as possible. Appreciate your feedback.

    Possible feature request – If the plugin parses the code and looks for those function calls, is it possible to also have the plugin output where those function calls with different text domains are so a user can easily find where the changes need to be made?

    Update, for what it’s worth:

    I had a dev colleague install the theme and take a look, everything checked out OK for him with the theme test.

    I tried switching back and forth from twentysixteen, but still got the same error of multiple text domains in use.

    I deleted my theme, reinstalled and then ran theme check – everything is fine.

    So in the end I guess it was some sort of weird caching happening? No caching in place on the server or with plugin-in use… Anyway, it’s all sorted now.

    Thanks for sticking through this with me. Would love to hear your thoughts on that feature request mentioned above.

    Juhi Patel

    (@juiiee8487)

    Warning: More than one text-domain is being used in this theme. This means the theme will not be compatible with WordPress.org language packs.
    The domains found are blog_theme, jp_blog_theme

    Please help me out there is only one text domain name “jp_blog_theme” across all files but still gave this Warning.

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    @juiiee8487 If it found that somewhere you’re using a text domain, then somewhere you’re using that text domain.

    Remember to remove any .git or .svn directories from what you’re scanning. The theme should not have those in it to start with. Scan only the final theme, not a work-in-progress.

    Also, don’t post in 6 month old threads. Start your own thread.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Text Domain Clarification’ is closed to new replies.