SMF Development > Fixed or Bogus Bugs

Birthday of users using an RTL name displays incorrectly

(1/1)

Doctor Deejay:
Appears on this forum, the user uses the English language pack, but the birthday displays right to left. Example is in the screenshot. :)

MrPhil:
OK, so the name is in some Arabic-family RTL script. Is the complaint that the age is to the left of the name (which would be reasonable for a RTL script name, although all others are LTR with age to the right), or that the closing parenthesis is facing the wrong way and is where it would be for a LTR entry? It looks like something is switching back to LTR either too early (leaving the closing parenthesis in the wrong place) or too late (placing the age to the left [later in sequence] of the name, rather than the right, as would be appropriate for English.

Does it behave this way on different browsers? Can you tell if the name includes RTL and LTR control codes, or is the browser figuring that out for itself? (or is SMF?) I don't have practical experience with RTL (bidirectional) scripts and languages, so I'll admit I'm just guessing here. UTF-8 encoding?

emanuele:
ehhh...tricky.

The only way I found to fix this is to replace:

--- Code: (find) --- <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong>' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '<br />' : ', ';
--- End code ---
with:

--- Code: (replace with) --- <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong style="display:inline-block">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '<br />' : ', ';
--- End code ---

That means add the style:

--- Code: --- style="display:inline-block"
--- End code ---
to the <strong> tag.
inline-block seems to be supported by IE (at least w3schools.com doesn't say it's not supported... :P).

If we can use this trick I think it would be better to change a bit the markup..i (i.e. assign a class to the <p> tag and apply the style from index.css)

emanuele:
Commit: 9bd5f4266c8367c3260084d6a1e843b43e7ee2c5

Navigation

[0] Message Index

Go to full version