nextcloud / nextcloud/suspicious_login

[I18N] Gettext escaping issue

Open
#655 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. to triage bug
Dominant language
PHP
Stars
106
Forks
32
Avg merge
8h 33m
Merged PRs (30d)
10

Description

I had an issue while translating the following string:

https://github.com/nextcloud/suspicious_login/blob/e5d32d099ec17efee0d84ac966dd6f01e6892ac1/src/components/ModelPerformance.vue#L31

The string in question is using a percent sign without escaping, which causes in a problem down the line. Specifically I cannot put suffixes after the % character, because it causes a validation error.

Just for further context, this part:

{recall}% of all suspicious logins

would be this in Hungarian:

összes gyanús bejelentkezés {recall}%-át

but I can't save this on Transifex (currently I am spelling out the percent as text).

I am not sure how it should be escaped, because I haven't used gettext in JavaScript yet, so I cannot give a solution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/components/ModelPerformance.vue around line 31 and inspect how the gettext string containing {recall}% is defined and translated. Check the related Transifex validation behavior, including the Hungarian suffix example; done means the percentage placeholder can be translated with suffixes without a validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
internationalization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.