This document provides reference information about Lychee's localization system, including file structure, translation key conventions, and usage in code.
Lychee supports multiple languages through Laravel's built-in localization system. Translation management is handled through Weblate, a self-hosted translation platform at https://weblate.lycheeorg.dev/.
Translations are organized in the lang/ directory:
lang/
├── ar/ # Arabic
├── cz/ # Czech
├── de/ # German
├── el/ # Greek
├── en/ # English (source language)
├── es/ # Spanish
├── fa/ # Persian/Farsi
├── fr/ # French
├── hu/ # Hungarian
├── it/ # Italian
├── ja/ # Japanese
├── nl/ # Dutch
├── no/ # Norwegian
├── pl/ # Polish
├── pt/ # Portuguese
├── ru/ # Russian
├── sk/ # Slovak
├── sv/ # Swedish
├── vi/ # Vietnamese
├── zh_CN/ # Chinese (Simplified)
└── zh_TW/ # Chinese (Traditional)
Each language directory contains the same set of PHP files that return associative arrays of translation keys:
all_settings.php- Comprehensive settings labels and descriptionsaspect_ratio.php- Aspect ratio and layout optionschangelogs.php- Version history and update informationdiagnostics.php- System diagnostics and health checksdialogs.php- Modal dialogs, confirmations, and user interactionsduplicate-finder.php- Duplicate photo detectionfix-tree.php- Album tree maintenance utilitiesflow.php- Photo flow/timeline interfacegallery.php- Main gallery interface, albums, photos, and navigationimport_from_server.php- Server-side import functionalityjobs.php- Background job status and managementlanding.php- Landing page contentleft-menu.php- Left sidebar navigation menumaintenance.php- Maintenance mode and system operationsprofile.php- User profile managementrenamer.php- Filename renaming rules interfacesettings.php- Application settings and configuration optionssharing.php- Album and photo sharing functionalitystatistics.php- Statistics and analytics displaystags.php- Tag management interfacetoasts.php- Notification messages and alertsuser-groups.php- User group managementusers.php- User management (admin features)webshop.php- E-commerce and webshop functionality
- Use snake_case for all keys
- Use descriptive names that indicate context
- Group related keys under common prefixes
- Avoid abbreviations unless they're widely understood
'album_create_button' => 'Create Album',
'photo_upload_success' => 'Photo uploaded successfully',
'settings_privacy_title' => 'Privacy Settings',
'error_network_timeout' => 'Network timeout occurred','btn' => 'Button', // Too vague
'msg1' => 'Success', // Non-descriptive
'albumcreate' => 'Create', // Poor formattingUse nested arrays for logical grouping:
return [
'album' => [
'actions' => [
'create' => 'Create Album',
'delete' => 'Delete Album',
'share' => 'Share Album',
],
'properties' => [
'title' => 'Title',
'description' => 'Description',
'public' => 'Public',
],
],
];// Simple translation
__('gallery.title')
// Nested key access
__('gallery.album.actions.create')
// With parameters
__('gallery.photos_count', ['count' => 5])// In Vue components (Composition API)
import { trans } from "laravel-vue-i18n";
// Simple translation
$t('gallery.title')
// Using trans function in script
trans('gallery.title')
// With parameters
$t('gallery.photos_count', { count: 5 })Lychee's test suite validates translation consistency:
- Complete Coverage: All keys present in English must exist in other languages
- No Extra Keys: Other languages cannot have keys not present in English
- File Structure: All language directories must have the same file structure
- Valid PHP Syntax: All translation files must be valid PHP arrays
# Run the full test suite (includes translation validation)
php artisan test
# Run specific translation tests
php artisan test --filter LangTest- Missing keys: A key exists in English but not in another language
- Extra keys: A key exists in a translation but not in English
- Syntax errors: Invalid PHP syntax in translation files
- Missing files: A translation file exists in English but not in other languages
- Use clear, concise language appropriate for the interface
- Maintain consistent tone throughout the application
- Consider context - where and how the text will be displayed
- Use proper capitalization following English UI conventions
- Avoid technical jargon unless necessary for the target audience
- Automatic Sync: Weblate syncs with the Git repository
- Translation Interface: Translators use the web interface to submit translations
- Quality Checks: Weblate validates translations for consistency and formatting
- Review Process: Translations can be reviewed before being committed
- Git Integration: Approved translations are automatically committed back to the repository
Weblate Instance: https://weblate.lycheeorg.dev/
Weblate provides a web-based interface for translators to contribute translations without needing to directly edit PHP files. It handles version control integration and maintains translation quality through validation rules.
- Translating Lychee - How-to guide for adding translations and new languages
- Coding Conventions - General coding standards
Last updated: January 21, 2026