Translate Strings in html tags for wordpress plugin
Question
I have two files for my wordpress plugin.
class-a.php
/*
Text Domain: class-a
Domain Path: /languages/
*/
class-a {
include( plugin_dir_path( __FILE__ ) . 'class-b.php' );
}
class-b.php
class-b {
function some_function{
<div><h2>Some text</h2></div>
}
}
I am trying to add translations to my plugin, and I am able to translate all the string in the class-a.php but I am facing issues translating string in class-b.php. I am assuming since class-b is included while class-a is loaded, the same text domain applies for class b as well.
My question
- Is my assumption right that the same text domain applies for class-b as well or I should add separate text domain for class-b
- What is right way to translate the html string.
0
2 months
0 Answers
16 views
0
Leave an answer
You must login or register to add a new answer .