This guide explains how to add internationalization (i18n) support for a new language in Fess.
Fess uses a two-tier language support system:
- Full UI Translation (13 languages): Complete user interface translation with label and message files
- Search/Analysis Support (40+ languages): Language-specific text analysis for search indexing
Currently supported UI languages: German, English, Spanish, French, Italian, Japanese, Korean, Dutch, Polish, Brazilian Portuguese, Russian, Simplified Chinese, and Traditional Chinese.
Language resource files are located in:
src/main/resources/
├── fess_label.properties # Base English labels (fallback)
├── fess_label_[locale].properties # Language-specific labels (~1,056 lines)
├── fess_message.properties # Base English messages (fallback)
└── fess_message_[locale].properties # Language-specific messages (~200 lines)
- Language only:
fess_label_en.properties,fess_label_ja.properties - Language + Region:
fess_label_pt_BR.properties,fess_label_zh_CN.properties,fess_label_zh_TW.properties - Special cases: Kurdish uses
fess_label_ckb_IQ.properties
Copy the base English files as templates:
cd src/main/resources
# Copy label file (~1,056 translation entries)
cp fess_label_en.properties fess_label_[your_locale].properties
# Copy message file (~200 translation entries)
cp fess_message_en.properties fess_message_[your_locale].propertiesExample for Swedish (sv):
cp fess_label_en.properties fess_label_sv.properties
cp fess_message_en.properties fess_message_sv.propertiesEdit the newly created files and translate all entries:
fess_label_[locale].properties contains UI labels such as:
labels.system_name=Fess
labels.search=Search
labels.login=Login
labels.logout=Logout
# ... approximately 1,056 more entriesfess_message_[locale].properties contains system messages such as:
errors.required={0} is required.
errors.minlength={0} cannot be less than {1}.
success.login=Logged in successfully.
# ... approximately 200 more entriesEdit src/main/resources/fess_config.properties:
Find the supported.languages property (around line 202) and ensure your language code is included:
supported.languages=ar,bg,bn,ca,ckb_IQ,cs,da,de,el,en_IE,en,es,et,eu,fa,fi,fr,gl,gu,he,hi,hr,hu,hy,id,it,ja,ko,lt,lv,mk,ml,nl,no,pa,pl,pt_BR,pt,ro,ru,si,sq,sv,ta,te,th,tl,tr,uk,ur,vi,zh_CN,zh_TW,zhOptional configurations:
If you create online help documentation:
online.help.supported.langs=ja,sv # Add your languageIf you have forum support:
forum.supported.langs=en,ja,sv # Add your languageFess uses DBFlute's LastaFlute FreeGen to automatically generate Java constants from property files.
Run the regeneration command:
# Option 1: Using Maven from project root
mvn dbflute:freegen
# Option 2: Using DBFlute manage script
cd dbflute_fess
./manage.sh # On Linux/Mac
manage.bat # On Windows
# Select option 23 (generate)This will regenerate:
src/main/java/org/codelibs/fess/mylasta/action/FessLabels.javasrc/main/java/org/codelibs/fess/mylasta/action/FessMessages.javasrc/main/java/org/codelibs/fess/mylasta/direction/FessProp.java
mvn clean package-
Start Fess:
# Run the main class in your IDE org.codelibs.fess.FessBoot -
Access the Admin UI:
http://localhost:8080/admin/ -
Test language selection:
- Check if your language appears in the language dropdown
- Force your language by adding URL parameter:
?browser_lang=[locale] - Example:
http://localhost:8080/admin/?browser_lang=sv
-
Verify translations:
- Navigate through different admin pages
- Check that labels and messages appear in your language
- Test error messages by submitting invalid forms
| File | Purpose |
|---|---|
fess_config.properties |
Main configuration file containing supported.languages |
fess_label_[locale].properties |
UI labels (~1,056 entries) |
fess_message_[locale].properties |
System messages (~200 entries) |
| Class | Location | Purpose |
|---|---|---|
FessProp |
org.codelibs.fess.mylasta.direction |
Configuration interface |
FessLabels |
org.codelibs.fess.mylasta.action |
Label constants (auto-generated) |
FessMessages |
org.codelibs.fess.mylasta.action |
Message constants (auto-generated) |
LanguageHelper |
org.codelibs.fess.helper |
Language detection and validation |
SystemHelper |
org.codelibs.fess.helper |
UI language dropdown builder |
FessUserLocaleProcessProvider |
org.codelibs.fess.mylasta.direction.sponsor |
User locale detection |
Fess determines the UI language in this order:
- Query parameter:
?browser_lang=[locale](highest priority) - Browser header:
Accept-Languageheader - Fallback: English (from
fess_label.propertiesandfess_message.properties)
During crawling and indexing, Fess:
- Detects language from document content using Apache Tika
- Validates against
supported.languageslist - Creates language-specific fields (e.g.,
content_ja,title_en,content_sv) - Applies language-specific analyzers for better search results
Configured in fess_config.properties:
indexer.language.fields=content,important_content,titleIf your language requires special text analysis (stemming, stop words, etc.), you may need to configure OpenSearch analyzers.
Edit src/main/resources/fess_indices/fess.json to add language-specific analyzers.
Example for Swedish:
{
"analysis": {
"filter": {
"swedish_stop": {
"type": "stop",
"stopwords": "_swedish_"
},
"swedish_stemmer": {
"type": "stemmer",
"language": "swedish"
}
},
"analyzer": {
"sv_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": ["lowercase", "swedish_stop", "swedish_stemmer"]
}
}
}
}Create custom dictionary files in: ${fess.dictionary.path}/[lang]/
Available dictionary types:
stopwords.txt- Words to exclude from indexingstemmer_override.txt- Custom stemming rulesprotwords.txt- Protected words (no stemming)mapping.txt- Character/token mappings
Example directory structure:
dictionary/
└── sv/
├── stopwords.txt
├── stemmer_override.txt
└── protwords.txt
- Language configuration is entirely file-based
- No database or OpenSearch index updates needed
- Settings are loaded at application startup and cached
If a translation is missing in fess_label_[locale].properties, Fess automatically falls back to the base fess_label.properties (English).
Use standard locale codes:
- ISO 639-1 language codes:
en,ja,de,fr,sv, etc. - With region when needed:
pt_BR,zh_CN,zh_TW,en_IE
- Language items are cached for 1 hour by
SystemHelper - Restart the application after adding new languages
Never edit these files manually (marked with @author FreeGen):
FessLabels.javaFessMessages.java
Always regenerate them using mvn dbflute:freegen
# 1. Navigate to resources directory
cd src/main/resources
# 2. Copy base files
cp fess_label_en.properties fess_label_sv.properties
cp fess_message_en.properties fess_message_sv.properties
# 3. Translate files (use your text editor)
# Edit fess_label_sv.properties - translate all ~1,056 entries
# Edit fess_message_sv.properties - translate all ~200 entries
# 4. Update configuration (ensure 'sv' is in supported.languages)
# Edit fess_config.properties line 202
# 5. Regenerate Java classes
cd ../../../..
mvn dbflute:freegen
# 6. Rebuild project
mvn clean package
# 7. Test
# Run org.codelibs.fess.FessBoot
# Access: http://localhost:8080/admin/?browser_lang=sv- Verify both
fess_label_[locale].propertiesandfess_message_[locale].propertiesexist - Check that locale code is in
supported.languagesinfess_config.properties - Regenerate Java classes:
mvn dbflute:freegen - Rebuild project:
mvn clean package - Restart Fess application
- Clear browser cache
- Force language with
?browser_lang=[locale]parameter - Check property file encoding (should be UTF-8 or use Unicode escapes
\uXXXX) - Verify property keys match exactly with base English files
- Check property file syntax (no unescaped special characters)
- Ensure all property values are properly escaped
- Run
mvn cleanbefore rebuilding
- Fess Configuration:
src/main/resources/fess_config.properties - DBFlute FreeGen Configuration:
dbflute_fess/dfprop/lastafluteMap.dfprop - OpenSearch Analysis:
src/main/resources/fess_indices/fess.json - LastaFlute Documentation: https://lastaflute.org/
- Create
fess_label_[locale].propertieswith ~1,056 translated entries - Create
fess_message_[locale].propertieswith ~200 translated entries - Add locale to
supported.languagesinfess_config.properties - Run
mvn dbflute:freegento regenerate Java classes - Run
mvn clean packageto rebuild project - Test language selection in admin UI
- (Optional) Configure OpenSearch analyzers in
fess.json - (Optional) Add custom dictionaries for search analysis
- Verify all UI pages display correctly in new language
- Test error messages and form validation
Congratulations! You've successfully added a new language to Fess.