Adding custom dictionaries to the server version

Introduction

The server version of ONLYOFFICE Docs allows the administrators to add custom dictionaries. Refer to the following guide to learn how to add your custom dictionary.

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 dictionaries within the directory must have the same language locale names (.dic, .aff). Please note that corresponding access rights shall be 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. Move or create one of each in the directory:
    • a .dic file (your_locale.dic) - a list of all the words in this dictionary.
    • an .aff file (your_locale.aff) - rules for affixes.
    • a .json file (your_locale.json) - a configuration file.

    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": [LCID_number]
    
    }

    Please refer to the following example on our GitHub.

  4. When you have added all the required dictionaries, run the following script from the server directory to update and process the dictionaries:
    update.py

    For Linux:

    /var/www/onlyoffice/documentserver/server/dictionaries/update.py

    For Windows:

    C:\Program Files\ONLYOFFICE\DocumentServer\server\dictionaries\update.py
  5. Restart the ONLYOFFICE services. For Docker installation, restart the Docker container.

    .gz files are created only in Docker installation.

  6. Clear the browser cache.

Host ONLYOFFICE Docs on your own server or use it in the cloud

Article with the tag:
Browse all tags