Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:

This usually happens when you've added or modified translation strings in your code but haven't updated the translation file.

Please run `pnpm i18n:extract` and commit the changes.
Please run `pnpm i18n:extract` and/or `pnpm i18n:extract:server` and commit the changes.
run: |
retry() { n=0; until "$@"; do n=$((n+1)); [ $n -ge 3 ] && break; echo "retry $n: $*" >&2; sleep 2; done; }
check_failed=0; node bin/check-i18n.js || check_failed=$?
Expand Down
65 changes: 39 additions & 26 deletions bin/check-i18n.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,52 @@
#!/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 scripts and compares en.json; 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 = [
{
localePath: path.join(__dirname, '..', 'src', 'i18n', 'locale', 'en.json'),
script: 'pnpm i18n:extract',
},
{
localePath: path.join(
__dirname,
'..',
'server',
'lib',
'i18n',
'locale',
'en.json'
),
script: 'pnpm i18n:extract:server',
},
];

try {
fs.copyFileSync(localePath, backupPath);
execSync('pnpm i18n:extract', { stdio: 'inherit' });
const original = fs.readFileSync(backupPath, 'utf8');
const extracted = fs.readFileSync(localePath, 'utf8');
fs.unlinkSync(backupPath);
for (const { localePath, script } of targets) {
const backupPath = `${localePath}.bak`;
try {
fs.copyFileSync(localePath, backupPath);
execSync(script, { stdio: 'inherit' });

if (original !== extracted) {
console.error(
"i18n messages are out of sync. Please run 'pnpm i18n:extract' and commit the changes."
);
process.exit(1);
}
} catch (err) {
if (fs.existsSync(backupPath)) {
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 '${script}' and commit the changes.`
);
process.exit(1);
}
} catch (err) {
if (fs.existsSync(backupPath)) {
fs.unlinkSync(backupPath);
}
throw err;
}
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.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
"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/lib/i18n/locale/*.json\" dist/lib && 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:server": "ts-node --project server/tsconfig.json server/lib/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 +37,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
74 changes: 72 additions & 2 deletions pnpm-lock.yaml

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

3 changes: 3 additions & 0 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import DiscoverSlider from '@server/entity/DiscoverSlider';
import { Session } from '@server/entity/Session';
import { User } from '@server/entity/User';
import { startJobs } from '@server/job/schedule';
import { initI18n } from '@server/lib/i18n';
import notificationManager from '@server/lib/notifications';
import DiscordAgent from '@server/lib/notifications/agents/discord';
import EmailAgent from '@server/lib/notifications/agents/email';
Expand Down Expand Up @@ -82,6 +83,8 @@ app
const settings = await getSettings().load();
restartFlag.initializeSettings(settings);

initI18n();

if (settings.network.forceIpv4First) {
axios.defaults.httpAgent = new http.Agent({ family: 4 });
axios.defaults.httpsAgent = new https.Agent({ family: 4 });
Expand Down
Loading
Loading