translation - Should I change text-domain of TGM library inside theme?

admin2025-06-06  2

I created a theme and I want to publish it in wordpress. I used TGM library to check to require plugins. but the Theme-check get bellow warning:

Warning: More than one text-domain is being used in this theme. This means the theme will not be compatible with WordPress language packs.

Should I change text-domain of TGM library? Or like the Envato, it's not necessary to change text-domain of TGM?

I created a theme and I want to publish it in wordpress. I used TGM library to check to require plugins. but the Theme-check get bellow warning:

Warning: More than one text-domain is being used in this theme. This means the theme will not be compatible with WordPress language packs.

Should I change text-domain of TGM library? Or like the Envato, it's not necessary to change text-domain of TGM?

Share Improve this question edited Nov 29, 2018 at 9:40 Krzysiek Dróżdż 25.6k9 gold badges53 silver badges74 bronze badges asked Nov 29, 2018 at 9:29 iliyamasiliyamas 133 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Themes should always have only one textdomain - most of the localization tools base on that assumption, so if you put multiple textdomains in the same theme, you make localizing it much harder.

As for wordpress... It is clearly stated that:

Themes that are hosted on WordPress the text domain must match the slug of your theme URL (wordpress/themes/). This is needed so that the translations from translate.wordpress work correctly.

The text domain name must use dashes and not underscores and be lowercase. For example, if the theme’s name My Theme is defined in the style.css or it is contained in a folder called my-theme the text domain should be my-theme.

The text domain is used in three different places:

In the style.css theme header As an argument in the localization functions As an argument when loading the translations using load_theme_textdomain() or load_child_theme_textdomain() style.css theme header #style.css theme header The text domain is added to the style.css header so that the theme meta-data like the description can be translated even when the theme is not enabled. The text domain should be same as the one used when loading the text domain.

Source: https://developer.wordpress/themes/functionality/internationalization/#text-domain

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749142497a316727.html

最新回复(0)