Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Wrong support of ' (single quote) in some places (French localisation) #273

Closed
LudovicRousseau opened this issue Sep 25, 2021 · 0 comments · Fixed by #274
Closed

Wrong support of ' (single quote) in some places (French localisation) #273

LudovicRousseau opened this issue Sep 25, 2021 · 0 comments · Fixed by #274
Labels
bug Something isn't working JS - Lychee-Front JavaScript related see https://github.com/LycheeOrg/Lychee-front

Comments

@LudovicRousseau
Copy link
Contributor

Detailed description of the problem

With the French version some texts are truncated.
For example instead of "Nom d'utilisateur actuel :" I see this:
Capture-d-ecran-2021-09-24-a-22 34 13

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',

I get the correct:
68747470733a2f2f66696c65732e6769747465722e696d2f3562383633346266643733343038636534666136326166622f6b6873392f7468756d622f436170747572652d642d656372616e2d323032312d30392d32352d612d31372e31392e30382e706e67

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.

@LudovicRousseau LudovicRousseau added bug Something isn't working JS - Lychee-Front JavaScript related see https://github.com/LycheeOrg/Lychee-front labels Sep 25, 2021
nagmat84 added a commit that referenced this issue Sep 27, 2021
@nagmat84 nagmat84 mentioned this issue Sep 27, 2021
ildyria pushed a commit that referenced this issue Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working JS - Lychee-Front JavaScript related see https://github.com/LycheeOrg/Lychee-front
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant