Adding custom dictionaries to the server version
Introduction
This guide explains how to add a custom dictionary to ONLYOFFICE Docs.
Adding a custom dictionary
-
When you have installed ONLYOFFICE Docs on your server, open the
dictionariesfolder.For Linux:
/var/www/onlyoffice/documentserver/dictionaries/For Windows:
C:\Program Files\ONLYOFFICE\DocumentServer\dictionaries -
Create a directory for the required dictionary. The folder name must include the language locale (e.g., fr_CA, de_DE), while the dictionary files within the directory must have the same language locale names (.dic, .aff). Make sure the required access rights are assigned, e.g.:
For Linux:
chown -R ds:ds /var/www/onlyoffice/documentserver/dictionaries/your_locale_directoryFor Windows:
Make sure that all the required services have access to the files.
-
Add the following files to the directory:
- a
.dicfile (your_locale.dic) — a list of all words in the dictionary. - an
.afffile (your_locale.aff) — rules for affixes. - a
.jsonfile (your_locale.json) — a configuration file.
noteIf you want to have a hyphenated dictionary, add a
hyph_your_locale.dicfile with the same locale name as your main dictionary (e.g.,hyph_fr_CA.dicfor thefr_CAdictionary). Make sure to use the same name as the common dictionary.The files should contain a
codesfield and the LCID values.{"codes": [1033]}notePlease refer to the following example on our GitHub.
- a
-
Once you have added all the required dictionary files, run the following script to update and process the dictionaries.
For Linux:
python3 /var/www/onlyoffice/documentserver/server/dictionaries/update.pyFor Windows:
python "C:\Program Files\ONLYOFFICE\DocumentServer\server\dictionaries\update.py" -
Restart the ONLYOFFICE services:
systemctl restart ds-converter ds-docservice ds-metricsFor Docker installation, restart the Docker container:
sudo docker restart documentservernote.gz files are created only in Docker installations.
-
Clear the browser cache.