I save my translated messages into a php file and inside a
define("TEXT", "text");
The thing is when i have a text that shows:
We have 30 users online.
and a user translates this message to his own language how am I supposed to show the users online when I get the translated text from the define variable?
For example, if the user translates the text to We have % users online.
Then I have in the php language file this:
define("USERS_ONLINE", "We have % users online");
Should I break the string and replace % with my total online users variable? Should I do the same with even more variables if needed?
I would recommend you to use printf-like syntax instead:
Then you can have multiple variables in the string: