Can not localize Collabora Code

Hi all.

I am using collabora/code: in a container environment.

Two questions here:

1- How to add a UI language and make it default? I can’t find it in the docs.

2- My instance has the necessary dictionary files out of the box for my desired language, but spellchecking doesn’t list that language on the UI. How to make it available an already installed language? And how to update those language files later? Is only downloading newer .aff and .dic files and overwriting enough?

Hey @TurabG, thanks for the questions + welcome to the forum. :slight_smile:

Which language are you using?

I explained how to change the UI to “Portuguese (Brazilian)” in this post:

At the end of your URL, you have to stick:

  • &lang=pt-BR

where pt-BR is whatever UI language you are trying to use.

On Default UI… see answer earlier in that same thread too:

Did you see the Collabora Online SDK:

Method #1: Docker Environment Variable

At startup, you can pass your docker an environment variable:

  • dictionaries

Method #2: coolwsd.xml File

The list of languages + how to expand them is also described in the Collabora Online SDK:

If you look inside the file:

  • coolwsd.xml

you should see a big list of:

<allowed_languages desc="List of supported languages of Writing Aids (spell checker, grammar checker, thesaurus, hyphenation) on this instance. Allowing too many has negative effect on startup performance." default="de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru">de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru</allowed_languages>

You can adjust those languages as needed.

Thank you @Tex, I enabled the desired language for spellchecking with the environment variable as you pointed out.

But I don’t understand how changing URL parameters will work through Collabora Online docker image? I am using Nextcloud for cloud storage and set it to use CODE server to edit files online which doesn’t involve direct URLs of Collabora. How to apply it?

Secondly, would overriding dictionary files with new versions be enough for updating them?

1 Like

Yes, I would suspect so.

What were the dictionary files you were hoping to expand? Do you have your own custom wordlist or something?

Hmmm, I’m unsure.

If you’re using Nextcloud, you might want to look into “NextCloud Office” instead.

It’s a custom fork that’s specifically tuned for Nextcloud:

I know that they automatically handle the UI language based on user. So:

  • A German user would automatically get the German UI.
  • An English user would automatically get the English UI.

I did a search through their code for the word “language”, and I think this might be the files (url.js + index.js) where they work their URL-substitution magic:

Thank you for you time. About the UI language, I think I will need to ask it in Nextcloud forums.

About spell-checking: how to set a default language system wide? Everytime I open a document, English (USA) is the default one. Because my Nextcloud UI is already a different language but Collabora is still displayed in English.

No, only for updating I asked. Because the dictionary versions shipped with Collabora is a bit old.