Fix language setting not being saved to database on admin settings page

- Added default_language field to general settings state in SettingsPage
- Replaced LanguageSelector component with simple select dropdown on settings page
- Fixed public settings endpoint to read general_default_language from database
- Language setting now properly saved when clicking Save Settings button
- Setting is correctly used by gallery login page and legal pages

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-08 09:49:45 +02:00
parent cfa0b0da69
commit 2012b0bab9
91 changed files with 6183 additions and 577 deletions
+10 -3
View File
@@ -5,9 +5,9 @@ const router = express.Router();
// Get public settings (branding and theme)
router.get('/', async (req, res) => {
try {
// Fetch branding and theme settings
// Fetch branding, theme, and general settings
const settings = await db('app_settings')
.whereIn('setting_type', ['branding', 'theme'])
.whereIn('setting_type', ['branding', 'theme', 'general'])
.select('setting_key', 'setting_value');
// Convert to object format
@@ -30,7 +30,14 @@ router.get('/', async (req, res) => {
branding_support_email: settingsObject.branding_support_email || '',
branding_footer_text: settingsObject.branding_footer_text || '',
branding_watermark_enabled: settingsObject.branding_watermark_enabled || false,
theme_config: settingsObject.theme_config || null
branding_watermark_logo_url: settingsObject.branding_watermark_logo_url || '',
branding_watermark_position: settingsObject.branding_watermark_position || 'bottom-right',
branding_watermark_opacity: settingsObject.branding_watermark_opacity || 50,
branding_watermark_size: settingsObject.branding_watermark_size || 15,
branding_favicon_url: settingsObject.branding_favicon_url || '',
branding_logo_url: settingsObject.branding_logo_url || '',
theme_config: settingsObject.theme_config || null,
default_language: settingsObject.general_default_language || 'en'
};
res.json(publicSettings);