-
Notifications
You must be signed in to change notification settings - Fork 506
Server Locale Requirements
ChurchCRM uses GNU gettext for internationalization and translation support. For translations to work properly, the server operating system must have the required locales installed and enabled. This is a critical system-level requirement that must be configured before ChurchCRM's multilingual features will function.
The PHP gettext extension relies on the operating system's locale libraries (specifically libc on Linux) to perform translations. When you select a language in ChurchCRM:
- ChurchCRM calls PHP's
setlocale()function with the selected language code - PHP's gettext extension looks for the locale on the system
- If the locale is not installed, gettext silently falls back to English
- Translation files (
.mofiles) are only loaded if the system locale exists
Important: Simply having translation files (.po and .mo) in ChurchCRM is not enough. The system must have the locale enabled.
# List all installed locales
locale -a
# Check if a specific locale is installed (e.g., Spanish)
locale -a | grep es_ES# List all installed locales
localectl list-locales
# Check if a specific locale is installed (e.g., Spanish)
localectl list-locales | grep es_ESChurchCRM uses standard locale codes in the format language_COUNTRY:
-
Spanish:
es_ES -
French:
fr_FR -
German:
de_DE -
Portuguese (Brazil):
pt_BR -
Chinese (Simplified):
zh_CN -
Japanese:
ja_JP -
Russian:
ru_RU
For a complete list of supported locales, see src/locale/locales.json in the ChurchCRM codebase.
Use the locale-gen command to generate and install locales:
# Install a specific locale (e.g., Spanish)
sudo locale-gen es_ES.UTF-8
# Install multiple locales
sudo locale-gen es_ES.UTF-8
sudo locale-gen fr_FR.UTF-8
sudo locale-gen de_DE.UTF-8
sudo locale-gen pt_BR.UTF-8
# Update the locale cache
sudo update-localeAlternative Method (Debian/Ubuntu):
# Edit the locale configuration file
sudo nano /etc/locale.gen
# Uncomment the locales you need (e.g., es_ES.UTF-8 UTF-8)
# Save and exit
# Generate the uncommented locales
sudo locale-gen# Install the language pack (e.g., Spanish)
sudo dnf install glibc-langpack-es
# Install multiple language packs
sudo dnf install glibc-langpack-es glibc-langpack-fr glibc-langpack-de
# Set system locale if needed
sudo localectl set-locale LANG=es_ES.UTF-8macOS typically has most locales pre-installed. To verify:
# List available locales
locale -a
# Most locales should be available by defaultUbuntu/Debian:
sudo locale-gen es_ES.UTF-8 # Spanish
sudo locale-gen fr_FR.UTF-8 # French
sudo locale-gen de_DE.UTF-8 # German
sudo locale-gen pt_BR.UTF-8 # Portuguese (Brazil)
sudo locale-gen zh_CN.UTF-8 # Chinese (Simplified)
sudo locale-gen ja_JP.UTF-8 # Japanese
sudo locale-gen ru_RU.UTF-8 # Russian
sudo locale-gen ar_SA.UTF-8 # Arabic
sudo locale-gen hi_IN.UTF-8 # HindiRocky Linux/RHEL/CentOS:
sudo dnf install glibc-langpack-es # Spanish
sudo dnf install glibc-langpack-fr # French
sudo dnf install glibc-langpack-de # German
sudo dnf install glibc-langpack-pt # Portuguese
sudo dnf install glibc-langpack-zh # Chinese
sudo dnf install glibc-langpack-ja # Japanese
sudo dnf install glibc-langpack-ru # Russian
sudo dnf install glibc-langpack-ar # Arabic
sudo dnf install glibc-langpack-hi # HindiAfter installing the required system locales:
- Log in to ChurchCRM as an administrator
- Navigate to Admin → Edit General Settings
- Click the Settings tab
- Select System Settings
- Click the Localization tab
- Change
sLanguageto your desired language from the dropdown - Click Save Changes
ChurchCRM will now use the selected language for the user interface.
If you've selected a language but the interface still appears in English:
-
Verify the system locale is installed:
locale -a | grep <your_locale>
-
Install the missing locale using the commands above
-
Restart the web server after installing locales:
# Apache sudo systemctl restart apache2 # or sudo systemctl restart httpd # nginx + PHP-FPM sudo systemctl restart php-fpm sudo systemctl restart nginx
-
Clear browser cache and reload ChurchCRM
-
Check ChurchCRM logs in Admin → System Logs for locale-related errors
Ensure the gettext PHP extension is installed:
# Check if gettext is enabled
php -m | grep gettext
# Install if missing (Ubuntu/Debian)
sudo apt-get install php-gettext
# Install if missing (Rocky Linux/RHEL)
sudo dnf install php-gettext
# Restart web server after installation
sudo systemctl restart apache2Verify that ChurchCRM has the compiled translation files:
# From ChurchCRM root directory
find src/locale/textdomain -name "*.mo"
# Should show files like:
# src/locale/textdomain/es_ES/LC_MESSAGES/messages.mo
# src/locale/textdomain/fr_FR/LC_MESSAGES/messages.moIf .mo files are missing, run the locale download command (requires development environment):
npm run locale:download- Install all locales you plan to support when setting up the server
-
Use UTF-8 encoding for all locales (e.g.,
es_ES.UTF-8notes_ES) - Restart the web server after installing new locales
- Test each language after enabling it in ChurchCRM
- Monitor logs for locale-related warnings
If you're on shared hosting (cPanel, Plesk, etc.):
- Contact your hosting provider to request locale installation
- Most providers have common locales (es_ES, fr_FR, de_DE) pre-installed
- Verify available locales with your hosting support
- If locales cannot be installed, choose hosting that supports your required languages
In your Dockerfile, install required locales. ChurchCRM's setup wizard will detect which locales are available on the system:
# Debian/Ubuntu base - Install specific locales
RUN apt-get update && apt-get install -y locales && \
locale-gen es_ES.UTF-8 && \
locale-gen fr_FR.UTF-8 && \
locale-gen de_DE.UTF-8 && \
locale-gen pt_BR.UTF-8 && \
locale-gen zh_CN.UTF-8 && \
update-locale
# Or install all locales (larger image size)
RUN apt-get update && apt-get install -y locales-allNote: ChurchCRM automatically detects available system locales during setup and shows their availability status. The setup wizard runs locale -a or uses setlocale() to check which locales are installed.
Symptom: PHP error like "locale 'es_ES' not supported by C library"
Solution: Install the locale on the system using locale-gen or dnf install glibc-langpack-*
Symptom: Translations work locally but fail on production server
Solution: Production server likely missing the locale. Install it using the commands for your distribution above.
Symptom: Partial translations appear
Possible Causes:
- Translation file incomplete (check POEditor translation progress)
- Some strings not yet extracted for translation
- Cache issue (clear browser cache)
Solution: Run npm run locale:audit to check translation completeness
- External Guide: How to Change Locale in Linux
- ChurchCRM Localization Overview: Localization
- For Developers: Localization For Developers
- For Translators: Localization For Translators
- System Prerequisites: ChurchCRM Application Platform Prerequisites
- Self-Hosting Setup: Self-Hosting on Linux
- Installation Guide ← Start here!
- First Run Setup
- Features Overview
- Upgrade Guide
- Backup & Restore
- Rollback Procedures
- File Permissions
- Troubleshooting
- Logging & Diagnostics
- SSL/HTTPS Security
- Localization Overview