Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
359 views
in Q2A Core by

for messages listed in qa-lang*.php files,  I wanna make part of a message bold. For instance this one:

Privacy: Your email address will only be used for sending these notifications.

something like:

Privacy: Your email address will only be used for sending these notifications.

but

...<b> only be used</b>... would not work.

Any tips please?

Q2A version: 1.5.4

2 Answers

+1 vote
by
I need to do the same thing! any solutions you found?
+1 vote
by

Hack method1 (for none-programer)

In the case of upper example:  qa-include/qa-app-format.php (around L1600)

//'note' => qa_lang_html('question/notify_email_note'),
'note' => qa_lang('question/notify_email_note'),
Note: *_html() functions excludes HTML tags from output string.
 

Hack method2 (for programer)

You should override function on your plugin after remodeling qa_lang_html() function in Q2A core.

qa-include/qa-base.php (around L1067)

function qa_lang_html($identifier)
/*
Return the translated string for $identifier, converted to HTML
*/
{
  if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }   // <=== Add one line
  return qa_html(qa_lang($identifier));
}
Example of override function .
function qa_lang_html($identifier)
{
if($identifier =='question/notify_email_note') {
  return qa_lang($identifier);
} else
  return qa_lang_html_base($identifier);
}
Note: My plugin (Lang Filter) will help your understanding.
 
If you understand PHP, I recommend method 2 with a few modified points of Q2A core. Of course there may be other methods, too.
by
can we do this without changing the core? just by writing plugins?
...