fix: Resolve i18n dependency issues for different environments

- Update i18n package versions to stable, compatible versions
- Add install-i18n.sh script for easy setup in any environment
- Create comprehensive I18N_SETUP.md troubleshooting guide
- Use legacy-peer-deps flag to avoid npm conflicts
- Provide clear instructions for Docker and local environments

This ensures the German translation feature works correctly
across different development and deployment environments.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-23 21:50:22 +02:00
parent 09c1578d6c
commit 508a844327
3 changed files with 157 additions and 3 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
# Script to install i18n dependencies for MinIO WebUI frontend
# This ensures proper installation in different environments
echo "Installing i18n dependencies for MinIO WebUI..."
# Remove existing node_modules and package-lock.json to ensure clean install
echo "Cleaning existing dependencies..."
rm -rf node_modules package-lock.json
# Install dependencies with legacy peer deps flag to avoid conflicts
echo "Installing dependencies..."
npm install --legacy-peer-deps
# Verify i18n packages are installed
echo "Verifying i18n packages..."
if npm list i18next react-i18next i18next-browser-languagedetector 2>/dev/null | grep -E "(i18next|react-i18next|i18next-browser-languagedetector)" > /dev/null; then
echo "✅ i18n packages installed successfully!"
echo ""
echo "Installed versions:"
npm list i18next react-i18next i18next-browser-languagedetector 2>/dev/null | grep -E "(i18next|react-i18next|i18next-browser-languagedetector)"
else
echo "❌ Error: i18n packages not found. Trying to install them explicitly..."
npm install i18next@^23.7.6 react-i18next@^13.5.0 i18next-browser-languagedetector@^7.2.0 --legacy-peer-deps
fi
echo ""
echo "Installation complete! You can now run 'npm start' to start the development server."
+3 -3
View File
@@ -16,13 +16,13 @@
"axios": "^1.6.5",
"chart.js": "^4.4.1",
"date-fns": "^3.2.0",
"i18next": "^25.3.2",
"i18next-browser-languagedetector": "^8.2.0",
"i18next": "^23.7.6",
"i18next-browser-languagedetector": "^7.2.0",
"react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.48.2",
"react-i18next": "^15.6.1",
"react-i18next": "^13.5.0",
"react-router-dom": "^6.21.1",
"react-scripts": "5.0.1",
"typescript": "^5.3.3",