mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-04-26 02:39:38 -05:00
Trivia: Fix translation formatting (#7175)
This commit is contained in:
parent
4318d7c9bc
commit
e47461da6d
|
|
@ -218,7 +218,7 @@
|
|||
"max-len": ["warn", {
|
||||
"code": 120, "tabWidth": 0,
|
||||
// see bottom of file for source
|
||||
"ignorePattern": "^\\s*(?:\\/\\/ \\s*)?(?:(?:export )?(?:let |const )?[a-zA-Z0-9_$.]+(?: \\+?=>? )|[a-zA-Z0-9$]+: \\[?|(?:return |throw )?(?:new )?(?:[a-zA-Z0-9$.]+\\()?)?(?:Utils\\.html|\\$\\()?['\"`/]"
|
||||
"ignorePattern": "^\\s*(?:\\/\\/ \\s*)?(?:(?:export )?(?:let |const )?[a-zA-Z0-9_$.]+(?: \\+?=>? )|[a-zA-Z0-9$]+: \\[?|(?:return |throw )?(?:new )?(?:[a-zA-Z0-9$.]+\\()?)?(?:Utils\\.html|(?:this\\.)?(?:room\\.)?tr|\\$\\()?['\"`/]"
|
||||
}],
|
||||
|
||||
// PS code (code specific to PS)
|
||||
|
|
@ -323,11 +323,12 @@ REGEXFREE SOURCE FOR IGNOREPATTERN: https://zarel.github.io/regexfree/
|
|||
|
||||
(
|
||||
Utils\.html
|
||||
|
|
||||
(this\.)?(room\.)?tr
|
||||
|
|
||||
\$\(
|
||||
)?
|
||||
|
||||
# start of string or regex
|
||||
['"`\/]
|
||||
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
"max-len": ["error", {
|
||||
"code": 120, "tabWidth": 0,
|
||||
// see bottom of .eslintrc-no-types.json for source
|
||||
"ignorePattern": "^\\s*(?:\\/\\/ \\s*)?(?:(?:export )?(?:let |const )?[a-zA-Z0-9_$.]+(?: \\+?=>? )|[a-zA-Z0-9$]+: \\[?|(?:return |throw )?(?:new )?(?:[a-zA-Z0-9$.]+\\()?)?(?:Utils\\.html|\\$\\()?['\"`/]"
|
||||
"ignorePattern": "^\\s*(?:\\/\\/ \\s*)?(?:(?:export )?(?:let |const )?[a-zA-Z0-9_$.]+(?: \\+?=>? )|[a-zA-Z0-9$]+: \\[?|(?:return |throw )?(?:new )?(?:[a-zA-Z0-9$.]+\\()?)?(?:Utils\\.html|(?:this\\.)?(?:room\\.)?tr|\\$\\()?['\"`/]"
|
||||
}],
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["error", {"args": "none"}],
|
||||
|
|
|
|||
|
|
@ -751,13 +751,13 @@ class Trivia extends Rooms.RoomGame {
|
|||
getWinningMessage(winners: TopPlayer[]) {
|
||||
const prizes = this.getPrizes();
|
||||
const [p1, p2, p3] = winners;
|
||||
const initialPart = Utils.html`${this.room.tr`${p1.name} won the game with a final score of <strong>${p1.player.points}</strong>, and `}`;
|
||||
const initialPart = this.room.tr`${Utils.escapeHTML(p1.name)} won the game with a final score of <strong>${p1.player.points}</strong>, and `;
|
||||
switch (winners.length) {
|
||||
case 1:
|
||||
return this.room.tr`${initialPart}their leaderboard score has increased by <strong>${prizes[0]}</strong> points!`;
|
||||
case 2:
|
||||
return this.room.tr`${initialPart}their leaderboard score has increased by <strong>${prizes[0]}</strong> points! ` +
|
||||
Utils.html`${this.room.tr`${p2.name} was a runner-up and their leaderboard score has increased by <strong>${prizes[1]}</strong> points!`}`;
|
||||
this.room.tr`${Utils.escapeHTML(p2.name)} was a runner-up and their leaderboard score has increased by <strong>${prizes[1]}</strong> points!`;
|
||||
case 3:
|
||||
return initialPart + Utils.html`${this.room.tr`${p2.name} and ${p3.name} were runners-up. `}` +
|
||||
this.room.tr`Their leaderboard score has increased by ${prizes[0]}, ${prizes[1]}, and ${prizes[2]}, respectively!`;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user