Skip to content

Commit 2dff4e3

Browse files
Merge pull request #283 from fabiodalez-dev/feat/danish-locale-279
Add Danish (da_DK) language support (#279)
2 parents 70b426d + 3611577 commit 2dff4e3

26 files changed

Lines changed: 7806 additions & 26 deletions

.github/workflows/ci-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
E2E_INSTALL_ROOT: ${{ github.workspace }}
4747

4848
steps:
49-
- uses: actions/checkout@v4
49+
- uses: actions/checkout@v6
5050

5151
# ── Apache2 + mod_php ───────────────────────────────────────────────────
5252
# Install Apache before setup-php adds external package sources; the app

.github/workflows/ci-quality.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
--health-retries=5
5252
5353
steps:
54-
- uses: actions/checkout@v4
54+
- uses: actions/checkout@v6
5555

5656
- name: Setup PHP
5757
uses: shivammathur/setup-php@v2
@@ -62,9 +62,9 @@ jobs:
6262
github-token: ''
6363

6464
- name: Setup Node
65-
uses: actions/setup-node@v4
65+
uses: actions/setup-node@v5
6666
with:
67-
node-version: '20'
67+
node-version: '22'
6868

6969
# ── Dependency CVE scanning ───────────────────────────────────────────
7070
- name: composer audit (known CVEs)

.github/workflows/ci-upgrade-smoke.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
--health-retries=5
6565
6666
steps:
67-
- uses: actions/checkout@v4
67+
- uses: actions/checkout@v6
6868

6969
- name: Setup PHP
7070
uses: shivammathur/setup-php@v2

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ Pinakes is a self-hosted, full-featured ILS for schools, municipalities, and pri
3737

3838
---
3939

40+
## What's New in v0.7.41
41+
42+
### Features
43+
- **Danish language (da_DK)** ([#279](https://github.com/fabiodalez-dev/Pinakes/issues/279)) — Danish is now a fully selectable interface language, contributed by [@HansUwe52](https://github.com/HansUwe52). Ships the complete UI catalogue (`locale/da_DK.json`, full key parity with the Italian source), route slugs (`locale/routes_da_DK.json`), and the fresh-install seed in Danish (`installer/database/data_da_DK.sql`: 181 genres, 22 email templates, CMS pages, settings). `da_DK` is wired into the installer language step, the email/route fallback chains, and the bundled-locale updater path. Emails fall back to English when a Danish template is missing.
44+
45+
### Fixes
46+
- **Danish installer seed selection** ([#279](https://github.com/fabiodalez-dev/Pinakes/issues/279)) — the installer's locale maps only knew `it/en/de/fr`, so a Danish install silently seeded the Italian catalogue (genres + emails). All four maps in `Installer.php`, plus `PrivateModeMiddleware` and the `Updater` bundled-locale list, now include `da_DK`. Restored dropped content in the Danish `loan_pickup_ready` email and added the missing `fr_FR` entry to the `I18n` fallback map.
47+
48+
### Database Changes
49+
- `migrate_0.7.41.sql` — registers the `da_DK` row in the `languages` table on existing installs (idempotent upsert), so Danish appears in the language UI after upgrading.
50+
51+
### Upgrade Notes
52+
- Back up your database before updating (the in-app updater does this automatically).
53+
54+
---
55+
4056
## What's New in v0.7.40
4157

4258
### Features

app/Middleware/PrivateModeMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PrivateModeMiddleware implements MiddlewareInterface
3232
];
3333

3434
/** Locales whose route variants are all registered in web.php. */
35-
private const LOCALES = ['it_IT', 'en_US', 'de_DE', 'fr_FR'];
35+
private const LOCALES = ['it_IT', 'en_US', 'de_DE', 'fr_FR', 'da_DK'];
3636

3737
/**
3838
* Path prefixes always allowed (assets, installer, infra endpoints).

app/Support/I18n.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ final class I18n
3434
'it_IT' => 'Italiano',
3535
'en_US' => 'English',
3636
'de_DE' => 'Deutsch',
37+
'fr_FR' => 'Français',
38+
'da_DK' => 'Dansk',
3739
];
3840

3941
/**

app/Support/SettingsMailTemplates.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ private static function localeOverrides(?string $locale): array
527527
return [];
528528
}
529529
// Map short and full codes to the locale files we ship.
530-
$map = ['en' => 'en_US', 'de' => 'de_DE', 'fr' => 'fr_FR', 'en_US' => 'en_US', 'de_DE' => 'de_DE', 'fr_FR' => 'fr_FR'];
530+
$map = ['en' => 'en_US', 'de' => 'de_DE', 'fr' => 'fr_FR', 'da' => 'da_DK', 'en_US' => 'en_US', 'de_DE' => 'de_DE', 'fr_FR' => 'fr_FR', 'da_DK' => 'da_DK'];
531531
$key = $map[$locale] ?? ($map[substr($locale, 0, 2)] ?? null);
532532
if ($key === null) {
533533
return [];

app/Support/Updater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2807,7 +2807,7 @@ private function isCustomLocalePath(string $relativePath): bool
28072807
if (preg_match('#^locale/(?:routes_)?([a-z]{2}_[A-Z]{2})\.json$#', $path, $matches) !== 1) {
28082808
return false;
28092809
}
2810-
return !in_array($matches[1], ['it_IT', 'en_US', 'de_DE', 'fr_FR'], true);
2810+
return !in_array($matches[1], ['it_IT', 'en_US', 'de_DE', 'fr_FR', 'da_DK'], true);
28112811
}
28122812

28132813
/**

0 commit comments

Comments
 (0)