Skip to content

Commit 58baf74

Browse files
authored
🐛 Fix translations failing (#3830)
* fix translations failing * release notes * blasphemy * more blasphemy * putting warning back * last heretic act * making the world a better place
1 parent d08be58 commit 58baf74

File tree

6 files changed

+22
-32
lines changed

6 files changed

+22
-32
lines changed

packages/loot-core/src/server/budget/cleanup-template.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// @ts-strict-ignore
2-
import { t } from 'i18next';
3-
42
import { Notification } from '../../client/state-types/notifications';
53
import * as monthUtils from '../../shared/months';
64
import * as db from '../db';
@@ -115,7 +113,7 @@ async function applyGroupCleanups(
115113
});
116114
}
117115
} else {
118-
warnings.push(groupName + t(' has no matching sink categories.'));
116+
warnings.push(groupName + ' has no matching sink categories.');
119117
}
120118
sourceGroups = sourceGroups.filter(c => c.group !== groupName);
121119
groupLength = sourceGroups.length;
@@ -220,7 +218,7 @@ async function processCleanup(month: string): Promise<Notification> {
220218
});
221219
num_sources += 1;
222220
} else {
223-
warnings.push(category.name + t(' does not have available funds.'));
221+
warnings.push(category.name + ' does not have available funds.');
224222
}
225223
const carryover = await db.first(
226224
`SELECT carryover FROM zero_budgets WHERE month = ? and category = ?`,
@@ -287,7 +285,7 @@ async function processCleanup(month: string): Promise<Notification> {
287285

288286
const budgetAvailable = await getSheetValue(sheetName, `to-budget`);
289287
if (budgetAvailable <= 0) {
290-
warnings.push(t('Global: No funds are available to reallocate.'));
288+
warnings.push('Global: No funds are available to reallocate.');
291289
}
292290

293291
//fill sinking categories
@@ -322,19 +320,19 @@ async function processCleanup(month: string): Promise<Notification> {
322320
return {
323321
type: 'error',
324322
sticky: true,
325-
message: t('There were errors interpreting some templates:'),
323+
message: 'There were errors interpreting some templates:',
326324
pre: errors.join('\n\n'),
327325
};
328326
} else if (warnings.length) {
329327
return {
330328
type: 'warning',
331-
message: t('Global: Funds not available:'),
329+
message: 'Global: Funds not available:',
332330
pre: warnings.join('\n\n'),
333331
};
334332
} else {
335333
return {
336334
type: 'message',
337-
message: t('All categories were up to date.'),
335+
message: 'All categories were up to date.',
338336
};
339337
}
340338
} else {
@@ -344,15 +342,13 @@ async function processCleanup(month: string): Promise<Notification> {
344342
if (errors.length) {
345343
return {
346344
sticky: true,
347-
message: t('{applied} There were errors interpreting some templates:', {
348-
applied,
349-
}),
345+
message: `${applied} There were errors interpreting some templates:`,
350346
pre: errors.join('\n\n'),
351347
};
352348
} else if (warnings.length) {
353349
return {
354350
type: 'warning',
355-
message: t('Global: Funds not available:'),
351+
message: 'Global: Funds not available:',
356352
pre: warnings.join('\n\n'),
357353
};
358354
} else {

packages/loot-core/src/server/budget/goaltemplates.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// @ts-strict-ignore
2-
import { t } from 'i18next';
3-
42
import { Notification } from '../../client/state-types/notifications';
53
import * as monthUtils from '../../shared/months';
64
import * as db from '../db';
@@ -190,13 +188,13 @@ async function processTemplate(
190188
if (catObjects.length === 0 && errors.length === 0) {
191189
return {
192190
type: 'message',
193-
message: t('Everything is up to date'),
191+
message: 'Everything is up to date',
194192
};
195193
}
196194
if (errors.length > 0) {
197195
return {
198196
sticky: true,
199-
message: t('There were errors interpreting some templates:'),
197+
message: 'There were errors interpreting some templates:',
200198
pre: errors.join(`\n\n`),
201199
};
202200
}
@@ -247,8 +245,6 @@ async function processTemplate(
247245

248246
return {
249247
type: 'message',
250-
message: t('Successfully applied templates to {length} categories', {
251-
length: catObjects.length,
252-
}),
248+
message: `Successfully applied templates to ${catObjects.length} categories`,
253249
};
254250
}

packages/loot-core/src/server/main.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import './polyfills';
33

44
import * as injectAPI from '@actual-app/api/injected';
55
import * as CRDT from '@actual-app/crdt';
6-
import { t } from 'i18next';
76
import { v4 as uuidv4 } from 'uuid';
87

98
import { createTestBudget } from '../mocks/budget';
@@ -1088,18 +1087,14 @@ function handleSyncError(err, acct) {
10881087
accountId: acct.id,
10891088
message: err.reason
10901089
? err.reason
1091-
: t(
1092-
'Account “{acctName}” is not linked properly. Please link it again.',
1093-
{ acctName: acct.name },
1094-
),
1090+
: `Account “${acct.name}” is not linked properly. Please link it again.`,
10951091
};
10961092
}
10971093

10981094
return {
10991095
accountId: acct.id,
1100-
message: t(
1096+
message:
11011097
'There was an internal error. Please get in touch https://actualbudget.org/contact for support.',
1102-
),
11031098
internal: err.stack,
11041099
};
11051100
}

packages/loot-core/src/server/mutators.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// @ts-strict-ignore
2-
import { t } from 'i18next';
3-
42
import { captureException, captureBreadcrumb } from '../platform/exceptions';
53
import { sequential } from '../shared/async';
64
import { type HandlerFunctions, type Handlers } from '../types/handlers';
@@ -123,7 +121,7 @@ export function getMutatorContext() {
123121
if (currentContext == null) {
124122
captureBreadcrumb({
125123
category: 'server',
126-
message: t('Recent methods: ') + _latestHandlerNames.join(', '),
124+
message: 'Recent methods: ' + _latestHandlerNames.join(', '),
127125
});
128126
// captureException(new Error('getMutatorContext: mutator not running'));
129127

packages/loot-core/src/server/sheet.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @ts-strict-ignore
22
import { type Database } from '@jlongster/sql.js';
3-
import { t } from 'i18next';
43

54
import { captureBreadcrumb } from '../platform/exceptions';
65
import * as sqlite from '../platform/server/sqlite';
@@ -133,7 +132,7 @@ export async function loadSpreadsheet(
133132
}
134133

135134
captureBreadcrumb({
136-
message: t('loading spreaadsheet'),
135+
message: 'loading spreadsheet',
137136
category: 'server',
138137
});
139138

@@ -163,7 +162,7 @@ export async function loadSpreadsheet(
163162
}
164163

165164
captureBreadcrumb({
166-
message: t('loaded spreaadsheet'),
165+
message: 'loaded spreadsheet',
167166
category: 'server',
168167
});
169168

upcoming-release-notes/3830.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: Maintenance
3+
authors: [MikesGlitch]
4+
---
5+
6+
Fix broken translations in worker files

0 commit comments

Comments
 (0)