nextcloud / nextcloud/suspicious_login
[I18N] Gettext escaping issue
Nobody has claimed this yet.
- 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:
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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