John Davidson

php - WordPress Translation Issue

0 comments
Message:


I am running the theme check plugin and came across this warning (below). I have added the text domain so I am not sure what the issue or solution is here?


WARNING: Found a translation function that is missing a text-domain in the file parts/header-pre.php. Function _e, with the arguments 'hr-listings'.

Line 153: <div class='cost'><?php _e('Prices start from: &pound;', 'hr-listings'); ?><?php echo $listing_cost_general; ?></div>


My Answer:
The warning message is indicating that there is a translation function (_e) being used without specifying a text-domain in the file parts/header-pre.php on line 153.

To resolve this issue, you need to make sure that the text-domain is specified when using translation functions in WordPress. In this case, you should update the code on line 153 to include the text-domain like this:

php
_e('hr-listings', 'your-text-domain');


Replace 'your-text-domain' with the actual text-domain of your theme or plugin. This will ensure that the translation function is properly registered and can be translated using language files.

Rate this post

3 of 5 based on 8392 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us