Skip to main content

Adding custom dictionaries to the server version

Introduction​

This guide explains how to add a custom dictionary to ONLYOFFICE Docs.

Adding a custom dictionary​

  1. When you have installed ONLYOFFICE Docs on your server, open the dictionaries folder.

    For Linux:

    /var/www/onlyoffice/documentserver/dictionaries/

    For Windows:

    C:\Program Files\ONLYOFFICE\DocumentServer\dictionaries
  2. 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_directory

    For Windows:

    Make sure that all the required services have access to the files.

  3. Add the following files to the directory:

    • a .dic file (your_locale.dic) — a list of all words in the dictionary.
    • an .aff file (your_locale.aff) — rules for affixes.
    • a .json file (your_locale.json) — a configuration file.
    note

    If you want to have a hyphenated dictionary, add a hyph_your_locale.dic file with the same locale name as your main dictionary (e.g., hyph_fr_CA.dic for the fr_CA dictionary). Make sure to use the same name as the common dictionary.

    The files should contain a codes field and the LCID values.

    {
    "codes": [1033]
    }
    note

    Please refer to the following example on our GitHub.

  4. 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.py

    For Windows:

    python "C:\Program Files\ONLYOFFICE\DocumentServer\server\dictionaries\update.py"
  5. Restart the ONLYOFFICE services:

    systemctl restart ds-converter ds-docservice ds-metrics

    For Docker installation, restart the Docker container:

    sudo docker restart documentserver
    note

    .gz files are created only in Docker installations.

  6. Clear the browser cache.