@@ -163,7 +166,7 @@ export class BattleRoom extends ChatRoom {
override interruptClose(explicit?: boolean, elem?: HTMLElement | null) {
if (this.isPlaying() || this.requireForfeit) {
PS.join('forfeitbattle' as RoomID, { parentElem: elem, parentRoomid: this.id });
- return `You are still in ${this.title}`;
+ return TL`You are still in ${this.title}`;
}
return super.interruptClose(explicit, elem);
}
@@ -171,22 +174,21 @@ export class BattleRoom extends ChatRoom {
return this.battle && !this.battle.ended && this.request && this.connectMode !== 'deleted';
}
updateChoiceNotification() {
- let oName = this.battle?.farSide.name;
- if (oName) oName = " against " + oName;
+ const oName = this.battle?.farSide.name;
let title = '';
let body = '';
switch (this.request?.requestType) {
case 'move':
- title = "Your move!";
- body = "Move in your battle" + oName;
+ title = BattleTextParser.ui('notifyMoveTitle');
+ body = oName ? BattleTextParser.ui('notifyMoveAgainst', { OPPONENT: oName }) : BattleTextParser.ui('notifyMove');
break;
case 'switch':
- title = "Your switch!";
- body = "Switch in your battle" + oName;
+ title = BattleTextParser.ui('notifySwitchTitle');
+ body = oName ? BattleTextParser.ui('notifySwitchAgainst', { OPPONENT: oName }) : BattleTextParser.ui('notifySwitch');
break;
case 'team':
- title = "Team preview!";
- body = "Choose your team order in your battle" + oName;
+ title = BattleTextParser.ui('notifyTeamTitle');
+ body = oName ? BattleTextParser.ui('notifyTeamAgainst', { OPPONENT: oName }) : BattleTextParser.ui('notifyTeam');
break;
}
@@ -235,12 +237,12 @@ export class BattleRoom extends ChatRoom {
this.connectError = null;
this.update(null);
} catch {
- this.connectError = `Battle "${replayid}" not found`;
+ this.connectError = TL`Battle "${replayid}" not found`;
if (!this.battle.stepQueue.length) {
this.battle.scene.message(
`
${BattleLog.escapeHTML(this.connectError)}
` +
- `The battle you're looking for has expired. Battles expire after 15 minutes of inactivity unless they're saved.
` +
- `In the future, remember to click "Save replay" to save a replay permanently.`
+ `${TL`The battle you're looking for has expired. Battles expire after 15 minutes of inactivity unless they're saved.`}
` +
+ TL`In the future, remember to click "Save replay" to save a replay permanently.`
);
}
this.update(null);
@@ -279,7 +281,7 @@ class TimerButton extends preact.Component<{ room: BattleRoom, top: number }> {
return `${minutes}:${(seconds < 10 ? '0' : '')}${seconds}`;
}
render() {
- let time = 'Timer';
+ let time = TL`Timer`;
const room = this.props.room;
if (!this.timerInterval && room.battle.kickingInactive) {
this.timerInterval = setInterval(() => {
@@ -338,7 +340,7 @@ class BattlePanel extends PSRoomPanel {
file.text().then(html => {
const titleStart = html.indexOf('');
const titleEnd = html.indexOf('');
- let title = 'Uploaded Replay';
+ let title = TL`Uploaded Replay`;
if (titleStart >= 0 && titleEnd > titleStart) {
title = html.slice(titleStart + 7, titleEnd - 1);
const colonIndex = title.indexOf(':');
@@ -352,7 +354,7 @@ class BattlePanel extends PSRoomPanel {
const index1 = html.indexOf('