This is the official website for AstroIndexer with automatic language detection and support for English and German.
The website automatically detects the user's preferred language based on:
- Saved preference (localStorage)
- URL parameter (?lang=de or ?lang=en)
- Browser language settings
- Timezone/location (fallback detection for German-speaking countries)
- Clean dropdown UI in the navigation bar
- Instant language switching without page reload
- Saves user preference for future visits
- Visual indicators for current language
- Mobile-friendly layout
- Adaptive navigation menu
- Optimized for all screen sizes
- English (en) - Default
- German (de)
website/
├── index.html # Main HTML file with data-i18n attributes
├── css/
│ ├── style.css # Main styles
│ └── language-switcher.css # Language switcher styles
├── js/
│ └── languages.js # Translation system and language detection
└── images/ # Website images and assets
- Check localStorage for saved preference
- Check URL parameter (?lang=)
- Detect from browser language (navigator.language)
- Check browser languages array
- Detect from timezone (for German-speaking regions)
All translations are stored in js/languages.js. To add new text:
translations.en.newSection = {
title: "English Title",
description: "English description"
};
translations.de.newSection = {
title: "Deutscher Titel",
description: "Deutsche Beschreibung"
};Add the data-i18n attribute to any element:
<h1 data-i18n="hero.title">Default Text</h1>
<p data-i18n="hero.description">Default description</p>- Create/Update the repository
astroindexerweb - Copy all files from the website folder
- Enable GitHub Pages in repository settings
- Custom domain (if using astroindexer.com):
- Add CNAME file with
astroindexer.com - Configure DNS settings
- Add CNAME file with
Both download buttons in the HTML need to be updated with the actual Google Drive link:
- Replace
https://drive.google.com/your-download-linkwith your actual download URL - The "Download AstroIndexer v19.6" button now points to the same Google Drive location
The system maintains clean URLs and adds language parameter only when needed:
- Default:
astroindexer.com - German:
astroindexer.com?lang=de - English (explicit):
astroindexer.com?lang=en
- HTML
langattribute updates automatically - Meta descriptions change based on language
- Open Graph tags update for social sharing
- Open
index.htmlin a web browser - Test language switching:
- Click the language switcher
- Add
?lang=deto the URL - Change browser language settings
- Check localStorage persistence
- Test responsive design
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Mobile browsers (iOS/Android)
- Add more languages (French, Spanish, Italian)
- Implement IP-based geolocation as additional detection method
- Add language-specific URLs (/en/, /de/)
- Implement hreflang tags for better SEO
- Add RTL language support
© 2024 AstroIndexer. All rights reserved.