Skip to content

Commit a6b24fb

Browse files
committed
chore: more translations
1 parent 223b0dd commit a6b24fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+293
-208
lines changed

lang/en/general.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"bypass.shift": "SHIFT: Bypass confirmation",
23
"changelog": "UnderScript Change Log",
34
"changelog.loading": "Please wait",
45
"changelog.unavailable": "Unavailable at this time",
@@ -10,6 +11,9 @@
1011
"collect": "Collect All",
1112
"collect.note": "Collect all rewards",
1213
"disenchant": "Smart Disenchant",
14+
"friend.block": "Block $1",
15+
"friend.decline": "Decline all",
16+
"match.found": "Match found!",
1317
"message.hidden": "Message Ignored",
1418
"message.removed": "$1 {{PLURAL:$1|Message|Messages}} Ignored",
1519
"deck.average": "Average gold cost",
@@ -25,16 +29,28 @@
2529
"* CTRL Click to erase deck"
2630
],
2731
"storage.save": "Click to save current deck",
32+
"time.local": "$1 local",
2833
"error": "Error",
2934
"go!": "Go now!",
35+
"page.first": "CTRL Click: Go to first page",
36+
"page.last": "CTRL Click: Go to last page",
3037
"passive": "Passive",
38+
"purchase.item": "Buy with UCP?",
39+
"purchase.item.cost": "Buy for {{UCP:$1}} UCP?",
40+
"purchase.pack.cost": "Buy $1 {{PLURAL:$1|pack|packs}} for {{UCP:$2}} UCP?",
41+
"purchase.pack.note": [
42+
"CTRL: Buy MAX packs",
43+
"ALT: Buy (up to) 10 packs"
44+
],
3145
"reconnecting": "Reconnecting...",
3246
"profile": "Profile",
3347
"message": "Message",
3448
"ignore": "Ignore",
3549
"unignore": "Unignore",
3650
"mention": "Mention",
3751
"mute": "Mute",
52+
"quest.pending": "Completed Quests",
53+
"random": "Random",
3854
"refresh": "Refresh Page",
3955
"settings": "Open Settings",
4056
"update.current": "Current: $1",
@@ -43,8 +59,11 @@
4359
"update.skip": "Skip Update",
4460
"updates": "Pending Updates",
4561
"dismiss": "Dismiss",
62+
"loading": "Loading",
4663
"open": "Open",
4764
"undo": "Undo",
4865
"update": "Update",
49-
"unknown": "Unknown"
66+
"unknown": "Unknown",
67+
"disable": "Disable",
68+
"enable": "Enable"
5069
}

lang/en/settings.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
"autocomplete": "Visual Autocomplete",
66
"autocomplete.friends": "Autocomplete: Online Friends Only",
77
"broadcast": "Disable Broadcast Toast",
8+
"card.name.english": "Force English for card names",
9+
"card.text.outline": "Add Text Outline",
10+
"card.tribe.outline": "Add Tribe Outline",
811
"category.announce.draw": "Legendary Draw",
912
"category.announce.user": "Legendary User",
1013
"category.announce.winstreak": "Winstreak",
14+
"category.autodecline": "Auto Decline",
15+
"category.card.skins": "Card Skins",
1116
"category.chat.commands": "Commands",
1217
"category.chat.emotes": "Emotes",
1318
"category.chat.ignored": "Ignored Users",
@@ -20,6 +25,8 @@
2025
"category.home": "Home",
2126
"category.hotkeys": "Hotkeys",
2227
"category.library.crafting": "Crafting",
28+
"category.minigames": "Minigames",
29+
"category.outline": "Outline",
2330
"category.plugins": "Plugins",
2431
"category.streamer": "Streamer Mode",
2532
"category.updates": "Updates",
@@ -54,12 +61,22 @@
5461
"Crafting",
5562
"Never"
5663
],
64+
"fishday": "Disable April Fools Jokes",
65+
"fishday.note": "Disables *almost* everything.",
66+
"friend.auto": "Disable",
67+
"friend.auto.ignore": "Include ignored chat users",
68+
"friend.auto.silent": "Silent",
69+
"friend.background": "Remove friends without refreshing",
70+
"friend.decline": "Disable decline all button",
71+
"friend.online": "Enable online friends",
72+
"friend.request": "Disable Friend Request Notifications",
5773
"friendship": "Disable Collect All",
5874
"friendship.notification": "Disable Friendship Notification",
5975
"friendship.rank": "Display Friendship Rankings",
6076
"game.season": "Disable version toast",
6177
"gamelist": "Disable Game List Resizing",
6278
"gamelist.refresh": "Disable Game List Refresh",
79+
"header.sticky": "Disable header scrolling",
6380
"ignore": "Disable",
6481
"ignore.how": "Behavior",
6582
"ignore.option": [
@@ -68,13 +85,21 @@
6885
"None"
6986
],
7087
"import.shiny": "Prefer Shiny",
88+
"key.any": "Press Any Key...",
89+
"key.bind": "Click to bind",
7190
"large.avatar": "Large Icon mode",
7291
"library.scrollwheel": "Disable Scrolling Collection with Mousewheel",
7392
"links": "Use Original Link Detection",
93+
"map.duplicate": "Duplicate value, not updated! Click here to reset.",
94+
"minigame": "Disable",
95+
"minigame.wasd": "Use WASD",
7496
"note.refresh": "Will require you to refresh the page.",
7597
"page.chat": "Chat",
98+
"page.friends": "Friends",
7699
"page.library": "Library",
77100
"page.plugins": "Plugins",
101+
"page.jump": "Disable First/Last Page Shortcut",
102+
"page.select": "Disable Page Select",
78103
"patches": "Disable Patch Notes",
79104
"ping": "Disable Chat Ping {{STYLE:highlight|(highlighting)}}",
80105
"ping.global": "Only open chats",
@@ -83,6 +108,14 @@
83108
"quest.highlight": "Disable Quest Highlight",
84109
"safelink": "Enabled",
85110
"safelink.trust": "Trust $1",
111+
"skins.basic": "Force Basic Card Skins",
112+
"skins.breaking": "Breaking Card Art Behavior",
113+
"skins.breaking.option": [
114+
"Breaking (Default)",
115+
"Covered (Transparent)",
116+
"Covered"
117+
],
118+
"skins.full": "Disable Full Card Art",
86119
"streamer": "Enable?",
87120
"streamer.note": "Enables a button on the menu, streamer mode is \"off\" by default.",
88121
"streamer.option": [

lang/en/toast.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"custom.ban.user": "'$1' has been banned from custom match!",
66
"custom.enter": "You can now press enter on the Create Game window.",
77
"dismiss": "Dismiss",
8+
"friend.request": "Pending Friend Request",
9+
"friend.request.accept": "Accepted friend request from: $1",
10+
"friend.request.auto": "Auto declined friend request from: $1",
11+
"friend.request.decline": "Declined friend request from: $1",
812
"friendship": "Claimed Friendship Rewards",
913
"friendship.notification": "Pending Friendship Rewards",
1014
"ignore": "You've ignored $1",

src/base/chat/context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ eventManager.on('jQuery', () => {
160160
},
161161
buttons: [{
162162
css: buttonCSS,
163-
text: Translation.UNDO.translate(),
163+
text: Translation.UNDO,
164164
className: 'dismiss',
165165
onclick: () => {
166166
settings.remove(key);

src/base/chat/ignore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function processMessage(message, room, history = false) {
7878
} else if (history) {
7979
msg.remove();
8080
}
81-
container.text(Translation.General('message.removed', count));
81+
container.text(Translation.General('message.removed').translate(count));
8282
count += 1;
8383
return true;
8484
} else if (type === 'none') {

src/base/chat/trustedLink.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ eventManager.on('BootstrapDialog:show', (dialog) => {
4747
const host = cache.value;
4848
const after = dialog.options.buttons[0];
4949
dialog.options.buttons.unshift({
50-
label: TrustDomain.withArgs(host).translate(),
50+
label: TrustDomain.translate(host),
5151
cssClass: 'btn-danger',
5252
action(ref) {
5353
register(host);

src/base/friends/autoDecline.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,29 @@ import onPage from 'src/utils/onPage.js';
77
import * as hover from 'src/utils/hover.js';
88
import each from 'src/utils/each.js';
99
import { captureError } from 'src/utils/sentry.js';
10+
import Translation from 'src/structures/constants/translation';
1011

1112
const disabled = settings.register({
12-
// TODO: translation
13-
name: 'Disable',
13+
name: Translation.Setting('friend.auto'),
1414
key: 'userscript.autodecline.disable',
1515
page: 'Friends',
16-
category: 'Auto Decline',
16+
category: Translation.CATEGORY_AUTO_DECLINE,
1717
});
1818

1919
const silent = settings.register({
20-
// TODO: translation
21-
name: 'Silent',
20+
name: Translation.Setting('friend.auto.silent'),
2221
key: 'underscript.autodecline.silent',
2322
default: true,
2423
page: 'Friends',
25-
category: 'Auto Decline',
24+
category: Translation.CATEGORY_AUTO_DECLINE,
2625
});
2726

2827
const chat = settings.register({
29-
// TODO: translation
30-
name: 'Include ignored chat users',
28+
name: Translation.Setting('friend.auto.ignore'),
3129
key: 'underscript.autodecline.ignored',
3230
default: true,
3331
page: 'Friends',
34-
category: 'Auto Decline',
32+
category: Translation.CATEGORY_AUTO_DECLINE,
3533
});
3634

3735
// Load blocked users
@@ -46,7 +44,7 @@ function register(key, name, set = false) {
4644
name,
4745
type: 'remove',
4846
page: 'Friends',
49-
category: 'Auto Decline',
47+
category: Translation.CATEGORY_AUTO_DECLINE,
5048
});
5149
if (set) {
5250
localStorage.setItem(key, name);
@@ -56,8 +54,7 @@ function register(key, name, set = false) {
5654
function post(id, name) {
5755
axios.get(`/Friends?delete=${id}`).then(() => {
5856
if (!name) return;
59-
// TODO: translation
60-
const message = `Auto declined friend request from: ${name}`;
57+
const message = Translation.Toast('friend.request.auto').translate(name);
6158
debug(message);
6259
if (!silent.value()) {
6360
toast(message);
@@ -103,8 +100,7 @@ onPage('Friends', function blockRequests() {
103100
el.find('a[href^="Friends?"]').remove();
104101
el.addClass('deleted');
105102
$(this).remove();
106-
// TODO: translation
107-
}).hover(hover.show(`Block ${el.text().substring(0, name)}`)));
103+
}).hover(hover.show(Translation.General('friend.block').withArgs(name))));
108104
});
109105
});
110106
});

src/base/friends/delete.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { toast, errorToast } from 'src/utils/2.toasts.js';
66
import decrypt from 'src/utils/decrypt.emails.js';
77
import style from 'src/utils/style.js';
88
import { captureError } from 'src/utils/sentry.js';
9+
import Translation from 'src/structures/constants/translation';
910

1011
const setting = settings.register({
11-
// TODO: translation
12-
name: 'Remove friends without refreshing',
12+
name: Translation.Setting('friend.background'),
1313
key: 'underscript.removeFriend.background',
1414
default: true,
1515
page: 'Friends',

src/base/friends/groupRequest.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import eventManager from 'src/utils/eventManager.js';
22
import * as settings from 'src/utils/settings/index.js';
33
import onPage from 'src/utils/onPage.js';
44
import * as hover from 'src/utils/hover.js';
5+
import Translation from 'src/structures/constants/translation';
56

67
settings.register({
7-
// TODO: translation
8-
name: 'Disable decline all button',
8+
name: Translation.Setting('friend.decline'),
99
key: 'underscript.disable.declineAll',
1010
refresh: true,
1111
page: 'Friends',
@@ -16,9 +16,12 @@ onPage('Friends', function groupButtons() {
1616
if (settings.value('underscript.disable.declineAll')) return;
1717
const declineAll = $('<span>');
1818
const container = $('p:contains("Friend requests")').append(' ', declineAll).parent();
19-
declineAll.text(' ').addClass('glyphicon glyphicon-remove red').css({
20-
cursor: 'pointer',
21-
}).hover(hover.show('Decline all')) // TODO: translation
19+
declineAll.text(' ')
20+
.addClass('glyphicon glyphicon-remove red')
21+
.css({
22+
cursor: 'pointer',
23+
})
24+
.hover(hover.show(Translation.General('friend.decline')))
2225
.click(() => {
2326
container.find('a[href^="Friends?delete="]').each(function declineFriend() {
2427
eventManager.emit('friendAction', $(this));

src/base/friends/online.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@ import { global } from 'src/utils/global.js';
44
import * as hover from 'src/utils/hover.js';
55
import style from 'src/utils/style.js';
66
import { name } from 'src/utils/user.js';
7+
import Translation from 'src/structures/constants/translation';
78

89
const setting = settings.register({
9-
// TODO: translation
10-
name: 'Enable online friends',
10+
name: Translation.Setting('friend.online'),
1111
key: 'underscript.enable.onlinefriends',
1212
default: true,
1313
page: 'Friends',
1414
});
15-
let target;
15+
let popper;
1616
export default function updateTip() {
17-
if (!target) return;
18-
// eslint-disable-next-line no-underscore-dangle
19-
target._tippy.popper.querySelector('.onlineFriends').innerHTML = global('selfFriends').filter(({ online }) => online).map((user) => name(user)).join('<br>') || 'None';
17+
if (!popper) return;
18+
popper.querySelector('.onlineFriends').innerHTML = global('selfFriends').filter(({ online }) => online).map((user) => name(user)).join('<br>') || 'None';
2019
}
2120
eventManager.on(':preload', () => {
2221
const px = 12;
@@ -30,9 +29,7 @@ eventManager.on(':preload', () => {
3029

3130
const el = document.querySelector('a span.nbFriends');
3231
if (!el) return;
33-
target = el.parentElement;
34-
// TODO: translation
35-
hover.tip('<div class="onlineFriends">(Loading)</div>', target, {
32+
hover.tip('<div class="onlineFriends">(Loading)</div>', el.parentElement, {
3633
arrow: true,
3734
distance: 0,
3835
follow: false,
@@ -41,5 +38,10 @@ eventManager.on(':preload', () => {
4138
placement: 'top-start',
4239
onShow: () => setting.value(),
4340
});
41+
// eslint-disable-next-line no-underscore-dangle
42+
popper = el.parentElement._tippy.popper;
4443
eventManager.on('Chat:Connected', updateTip);
44+
eventManager.on('underscript:ready', () => {
45+
popper.querySelector('.onlineFriends').textContent = Translation.General('loading');
46+
});
4547
});

0 commit comments

Comments
 (0)