Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
in Q2A Core by
There are multiple translation strings that contain the number "1" (e.g. 1 minute, 1 point etc.)

Q2A requires that the number "1" will also appear in the translation, otherwise errors are generated.

For some languages, this constraint may be awkward.

For example, for Hebrew,
נקודה 1
Is way less elegant than:
נקודה אחת

(in fact, it's even possible that for some languages the problem may be even greater, and there is no straight forward way to include the number 1 in a singular expression. The variety of ways languages do stuff is amazing).

Could this requirement from the translation string be removed?

1 Answer

0 votes
I've tried to keep numbers out of translations as much as possible, and I'm not sure this will be a common requests for other languages.

In the meantime, if you'd like to get around this issue, you can modify the qa_post_html_fields(...) function in qa-app-format.php - look at this pair of lines:

$fields['points']=($post['points']==1) ? qa_lang_html_sub_split('main/1_point', '1', '1')
    : qa_lang_html_sub_split('main/x_points', qa_html(number_format($post['points'])));

... and change to something like ...

$fields['points']=($post['points']==1) ? qa_lang_html_sub_split('main/1_point', '[YOUR PHRASE]', '1')
    : qa_lang_html_sub_split('main/x_points', qa_html(number_format($post['points'])));

Where [YOUR PHRASE] is substituted as appropriate.
thanks, I'll use that.