Wrong support of ' (single quote) in some places (French localisation)
LudovicRousseau opened this issue · comments
Detailed description of the problem
With the French version some texts are truncated.
For example instead of "Nom d'utilisateur actuel :
" I see this:
The text comes from https://github.com/LycheeOrg/Lychee/blob/master/app/Locale/French.php#L325:
'USERNAME_CURRENT' => 'Nom d\'utilisateur actuel :',
Steps to reproduce the issue
- switch the interface in French
- go to Parameters (so Paramètres in French)
- erase the first field if you login is present and see the hint message
The problem
I discussed the issue on https://gitter.im/LycheeOrg/Lobby with @nagmat84
It looks like the problematic code is https://github.com/LycheeOrg/Lychee-front/blob/master/scripts/main/view.js#L927
<p>
` +
lychee.locale["PASSWORD_TITLE"] +
`
<input name='oldUsername' class='text' type='text' placeholder='` +
lychee.locale["USERNAME_CURRENT"] +
`' value=''>
<input name='oldPassword' class='text' type='password' placeholder='` +
lychee.locale["PASSWORD_CURRENT"] +
`' value=''>
</p>
Working cases
In other places the single quotes are correctly displayed.
For example with the login screen that uses:
'USERNAME' => 'Nom d\'utilisateur',
The corresponding code is https://github.com/LycheeOrg/Lychee-front/blob/master/scripts/main/lychee.js#L352
<p class='signIn'>
<input class='text' name='username' autocomplete='on' type='text' placeholder='$${
lychee.locale["USERNAME"]
}' autocapitalize='off' data-tabindex='${tabindex.get_next_tab_index()}'>
<input class='text' name='password' autocomplete='current-password' type='password' placeholder='$${
lychee.locale["PASSWORD"]
}' data-tabindex='${tabindex.get_next_tab_index()}'>
</p>
Possible solution
In the case the quote are correctly displayed the PHP code uses $${lychee.locale["USERNAME"]}
instead of just lychee.locale["USERNAME_CURRENT"]
.
It looks like the use of $${ }
is important here.