Extra development on the bug:
The html elements are only stripped when set to a javascript variable. That seems a vital clue to solving all of this.
The ideal solution for me (although those with different graphic design perspectives may disagree) is having "<br>" part of the English translation, so the German translation would be "Firstcatchenzung" if the system allows the break to be removed, and "Firstcatchenzung<br>" if it doesn't.
I think I've got this thing solved now. I just need to choose the right encode and decode function:
Code: Select all
var jstpl_foo = encodeFunction('<h1>{The_First_Catch}</h1>')
Then in javascript, when the variable is called,
Code: Select all
bar = decodeFunction(this.format_block( 'jstpl_foo', {}));
Still not the most elegant solution, but at least it keeps all the strings where I'd expect them to be if I ever want to edit them in ten years.
Okay, the technical side solved, now I can discuss graphic design. Keep in mind, I'm not looking for graphic design help. I'm merely describing the graphic design choices I have made and why I have made them. So please don't take it to heart if I do not adopt your solution over my own. I'm already feeling awkward enough about my need to justify my choices to people who've never seen my code or played my game. (Sure, if your solution is the best thing ever, I'll adopt it, but don't take it to heart if I disagree.)
Without line breaks, it would display:
"
The First Catch
"
"
The Second
Catch
"
In English, that just looks wrong to my eye.
Two player roles, almost identical, one with a single line title and the other with a two line title.
Now yes, I could use the div and div wrapper trick to restrict the space inside, forcing them both to display as I intended, but that will create unnecessary restrictions on title lengths for translators. If there's not enough room for "The First Catch", how can I be sure there will be enough room for "Firstcatchenzung"?
Also, this is only the "simplified for technical support" version of the issue. The full issue involves a font awesome icon displayed after "Catch" to show each player's colour, and future developments may make the issue more complex still.
This is why, when I ask for help, I'm always looking for a general tool to solve a category of problem, rather than a solution for this exact problem I'm facing now in the exact form it is in now.
Once I've worked out which encode and decode function work best for my use case, I'll upload the answer and mark my question as solved. But beyond that, I think I'm done here. I'll get back to work.
Thank you and goodbye.