Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 27 additions & 22 deletions bin/check-i18n.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
#!/usr/bin/env node

/* eslint-disable @typescript-eslint/no-require-imports, no-console */
/**
* Check that i18n locale files are in sync with extracted messages.
* Runs `pnpm i18n:extract` and compares en.json; exits 1 if they differ.
* Runs extract script and compares en.json files; exits 1 if they differ.
*/
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');

const localePath = path.join(
__dirname,
'..',
'src',
'i18n',
'locale',
'en.json'
);
const backupPath = `${localePath}.bak`;
const targets = [
path.join(__dirname, '..', 'src', 'i18n', 'locale', 'en.json'),
path.join(__dirname, '..', 'server', 'i18n', 'locale', 'en.json'),
];

const backups = targets.map((p) => `${p}.bak`);

try {
fs.copyFileSync(localePath, backupPath);
targets.forEach((p, i) => fs.copyFileSync(p, backups[i]));
execSync('pnpm i18n:extract', { stdio: 'inherit' });
const original = fs.readFileSync(backupPath, 'utf8');
const extracted = fs.readFileSync(localePath, 'utf8');
fs.unlinkSync(backupPath);

if (original !== extracted) {
console.error(
"i18n messages are out of sync. Please run 'pnpm i18n:extract' and commit the changes."
);
let outOfSync = false;
for (let i = 0; i < targets.length; i++) {
const original = fs.readFileSync(backups[i], 'utf8');
const extracted = fs.readFileSync(targets[i], 'utf8');
fs.unlinkSync(backups[i]);

if (original !== extracted) {
console.error(
`i18n messages are out of sync for ${path.basename(path.dirname(path.dirname(targets[i])))}. Please run 'pnpm i18n:extract' and commit the changes.`
);
outOfSync = true;
}
}

if (outOfSync) {
process.exit(1);
}
} catch (err) {
if (fs.existsSync(backupPath)) {
fs.unlinkSync(backupPath);
}
backups.forEach((b) => {
if (fs.existsSync(b)) fs.unlinkSync(b);
});
throw err;
}
8 changes: 8 additions & 0 deletions docs/using-seerr/notifications/discord.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ If you would like to override the name you configured for your bot in Discord, y
### Bot Avatar URL (optional)

Similar to the bot username, you can override the avatar for your bot.

### Use Notification Recipient Locale

When enabled, notifications will be sent in the language of the user who triggered the notification (e.g., the user who made the request or reported the issue) based on their display language setting. When disabled, the **Notification Language** setting below is used instead.

### Notification Language

Sets the language for all notifications sent to this Discord channel. This option is only available when **Use Notification Recipient Locale** is disabled.
4 changes: 4 additions & 0 deletions docs/using-seerr/notifications/email.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ sidebar_position: 1
If the [Application URL](/using-seerr/settings/general#application-title) setting is configured in **Settings → General**, Seerr will explicitly set the origin server hostname when connecting to the SMTP host.
:::

### Require User Email

When enabled, users will be required to provide a valid email address in their user settings. This is useful if you want to ensure all users can receive email notifications.

### Sender Name (optional)

Configure a friendly name for the email sender (e.g., "Seerr").
Expand Down
4 changes: 4 additions & 0 deletions docs/using-seerr/notifications/gotify.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ Add an application to your Gotify server, and set this field to the generated ap
:::info
Please refer to the [Gotify API documentation](https://gotify.net/docs) for more details on configuring these notifications.
:::

### Notification Language

Sets the language for notifications sent to this Gotify server.
4 changes: 4 additions & 0 deletions docs/using-seerr/notifications/ntfy.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ Set the priority level for notifications. Options range from Minimum (1) to Urge
:::info
Please refer to the [ntfy.sh API documentation](https://docs.ntfy.sh/) for more details on configuring these notifications.
:::

### Notification Language

Sets the language for notifications sent to this ntfy server.
4 changes: 4 additions & 0 deletions docs/using-seerr/notifications/slack.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ Simply [create a webhook](https://my.slack.com/services/new/incoming-webhook/) a
:::info
Please refer to the [Slack API documentation](https://api.slack.com/messaging/webhooks) for more details on configuring these notifications.
:::

### Notification Language

Sets the language for notifications sent to this Slack channel.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"preinstall": "npx only-allow pnpm",
"postinstall": "next telemetry disable",
"dev": "nodemon -e ts --watch server --watch seerr-api.yml -e .json,.ts,.yml -x ts-node -r tsconfig-paths/register --files --project server/tsconfig.json server/index.ts",
"build:server": "tsc --project server/tsconfig.json && copyfiles -u 2 server/templates/**/*.{html,pug} dist/templates && tsc-alias -p server/tsconfig.json",
"build:server": "tsc --project server/tsconfig.json && copyfiles -u 2 server/templates/**/*.{html,pug} dist/templates && copyfiles -u 2 \"server/i18n/locale/*.json\" dist/i18n && tsc-alias -p server/tsconfig.json",
"build:next": "next build",
"build": "pnpm build:next && pnpm build:server",
"lint": "eslint \"./server/**/*.{ts,tsx}\" \"./src/**/*.{ts,tsx}\" --cache",
"lintfix": "eslint \"./server/**/*.{ts,tsx}\" \"./src/**/*.{ts,tsx}\" --fix",
"test": "node server/test/index.mts",
"start": "NODE_ENV=production node dist/index.js",
"i18n:extract": "ts-node --project server/tsconfig.json src/i18n/extractMessages.ts",
"i18n:extract": "ts-node --project server/tsconfig.json server/i18n/extractMessages.ts",
"migration:generate": "ts-node -r tsconfig-paths/register --project server/tsconfig.json ./node_modules/typeorm/cli.js migration:generate -d server/datasource.ts",
"migration:create": "ts-node -r tsconfig-paths/register --project server/tsconfig.json ./node_modules/typeorm/cli.js migration:create -d server/datasource.ts",
"migration:run": "ts-node -r tsconfig-paths/register --project server/tsconfig.json ./node_modules/typeorm/cli.js migration:run -d server/datasource.ts",
Expand All @@ -36,6 +36,7 @@
"dependencies": {
"@dr.pogodin/csurf": "^1.16.6",
"@fontsource-variable/inter": "^5.2.8",
"@formatjs/intl": "^4.1.4",
"@formatjs/intl-displaynames": "6.8.13",
"@formatjs/intl-locale": "3.1.1",
"@formatjs/intl-pluralrules": "5.4.6",
Expand Down
71 changes: 70 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading