Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-22205: Underline inline link in CSRF confirmation Panel #3200

Merged
merged 6 commits into from
Nov 22, 2024

Conversation

Sereza7
Copy link
Contributor

@Sereza7 Sereza7 commented Jun 12, 2024

Jira URL

https://jira.xwiki.org/browse/XWIKI-22205

Changes

Description

  • Fixed all the translation values by adding a class to force this specific link to be underlined.

Clarifications

  • This translation breaks a lot of our translation rules, but reworking it (and probably deprecating the old translation key) is out of the scope of this PR. I decided to update all the instances of this translation instead. It was possible to figure out what markup needs an update whatever the language, so this solution seemed correct.

Screenshots & Video

None.

Executed Tests

None. This is a style only change with a very low scope.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • None

* Fixed all the translation values by adding a class to force this specific link to be underlined.
Copy link
Member

@surli surli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd really won't go towards this solution. The translation is already bad and adding the class is really not improving anything. I prefer we keep having the bug and we fix once for all the translations to get rid of all html.

@Sereza7 Sereza7 marked this pull request as draft October 15, 2024 09:22
* Replaced all the HTML with parameters in the english translation and both of its uses
TODO: update all the translations with actual values
@@ -3640,7 +3640,7 @@ XWiki.SearchSuggestSourceClass_activated=Activated
XWiki.SearchSuggestSourceClass_activated.hint=Whether this source is used or not (as long as the source search engine matches the search engine used by the current wiki).

### CSRFToken resources
csrf.confirmation=<p>This request contains an invalid authentication information.</p><p>This might happen in the following situations:</p><ul><li>You left the editor open in another window/tab and logged off and on again</li><li>Your authentication token expired after a long period of inactivity</li><li>Somebody tried to perform a CSRF attack</li></ul><p>If you are sure that none of these situations apply in your case, you might have found a bug. We are sorry about that, please report it on <a href="http://jira.xwiki.org/">XWiki JIRA</a></p><p>Do you want to resend the request? If unsure, say <strong>No</strong>.</p>
csrf.confirmation={0}This request contains an invalid authentication information.{1}{2}This might happen in the following situations:{3}{4}You left the editor open in another window/tab and logged off and on again{5}{6}Your authentication token expired after a long period of inactivity{7}{8}Somebody tried to perform a CSRF attack{9}{10}If you are sure that none of these situations apply in your case, you might have found a bug. We are sorry about that, please report it on {11}XWiki JIRA{12}{13}Do you want to resend the request? If unsure, say {14}No{15}.{16}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@surli Does this solution look good to you?
Technically we're breaking backward compatibility on this translation key (the number of parameters was changed). Should I deprecate this exact key and introduce a new one with the correct amount of parameters?

Since updating all the translations will take a bit of time, I want to make sure we're on the same line before doing it :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I deprecate this exact key and introduce a new one with the correct amount of parameters?

Yes you should do that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we could also decide to split this translation in multiple keys: e.g. one key for the message title, one for a description, one for details. Might be more clean.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did split this translation in multiple parts according to your comment 👍
I'm not 100% certain on how to name those parts, we might need to change this before a merge.
See my message below for a view of the manual tests I just made to make sure I didn't break the templates with these updates.

@Sereza7 Sereza7 marked this pull request as ready for review October 23, 2024 08:24
* Deprecated the old translation key that contained HTML syntax
* Replaced it with a juxtaposition of smaller translations.
* When nesting was needed, used parameters to make sure we don't have syntax inside the translation values.
* Updated the two uses of the old translation key
@Sereza7
Copy link
Contributor Author

Sereza7 commented Nov 4, 2024

Here is what the UI using the updated translations look like after the changes proposed in this PR:
Screenshot from 2024-11-04 16-14-44
Screenshot from 2024-11-04 15-29-42

@surli surli merged commit cf1c0d5 into xwiki:master Nov 22, 2024
2 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 22, 2024
* Deprecated the old translation key that contained HTML syntax
* Replaced it with a juxtaposition of smaller translations.
* When nesting was needed, used parameters to make sure we don't have syntax inside the translation values.
* Updated the two uses of the old translation key

(cherry picked from commit cf1c0d5)
surli pushed a commit that referenced this pull request Nov 22, 2024
* Deprecated the old translation key that contained HTML syntax
* Replaced it with a juxtaposition of smaller translations.
* When nesting was needed, used parameters to make sure we don't have syntax inside the translation values.
* Updated the two uses of the old translation key

(cherry picked from commit cf1c0d5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants