Seafile + Collabora CODE default language

Hi there,

I’m using seafile and collabora together on my raspberry pi 4 and it’s working great.
One problem though, I can’t seem to set the default language for my documents (spreadsheets specifically) so all the dates appear in the american format when I’m a UK user.

As mentioned here:
https://sdk.collaboraonline.com/docs/installation/CODE_Docker_image.html#setting-the-application-configuration-dynamically-via-environment-variables

I have tried to set the dictionaries environment variable within the collabora docker-compose:
But this doesn’t seem to have worked. Though I’m not convinced this is the right option to change?

- "dictionaries=en_GB"

If I change the default of a particular spreadsheet it seems to remember it from then on, but I want this changed for all spreadsheets by default.

I’ve searched around and don’t seem to be able to find the solution to this.

Any advice?

I know this is quite an old topic, but here is the explanation for this topic, because I had the same problem with Swiss language.

Seafile generates this HTML to open an office document with Collabora:

As you can see, seafile is generating a URL with the parameters for lang, rs and ui.

lang, rs and ui are generated from your current seafile ui language. The mapping table can be found in seafile-server-latest/seahub/seahub/wopi/utils.py and is looking like this:

lang_dict = {
        "ar": "ar-SA",
        "ca": "ca-ES",
        "cs": "cs-CZ",
        "de": "de-DE",
        "el": "el-GR",
        "en": "en-US",
        "es": "es-ES",
        "es-ar": "es-ES",
        "es-mx": "es-ES",
        "fi": "fi-FI",
        "fr": "fr-FR",
        "he": "he-IL",
        "hu": "hu-HU",
        "is": "is-IS",
        "it": "it-IT",
        "ja": "ja-JP",
        "ko": "ko-KR",
        "lv": "lv-LV",
        "nl": "nl-NL",
        "pl": "pl-PL",
        "pt-br": "pt-BR",
        "ru": "ru-Ru",
        "sl": "sl-SI",
        "sv": "sv-SE",
        "th": "th-TH",
        "tr": "tr-TR",
        "uk": "uk-UA",
        "vi": "vi-VN",
        "zh-cn": "zh-CN",
        "zh-tw": "zh-TW",
    }
    WOPI_UI_LLCC = lang_dict[language_code]

    # `lang` parameter is used for Collabora Office
    full_action_url += f'&ui={WOPI_UI_LLCC}&rs={WOPI_UI_LLCC}&lang={WOPI_UI_LLCC}'

From this, I don’t see any chance, that you get an en-UK interface, because there is no mapping for that.


Nevertheless, here is a very dirty hack, if you’re using docker. As you can see, I add command to replace the desired starting command and extend it with sed.

services:
 seafile:
   image: ${SEAFILE_IMAGE:-datamate/seafile-professional:11.0.18}
   restart: unless-stopped
   container_name: seafile-server
   command: |
     sh -c "\
     sed -i 's/de-DE/de-CH/g' /opt/seafile/seafile-pro-server-11.0.18/seahub/seahub/wopi/utils.py && \
     /sbin/my_init -- /scripts/enterpoint.sh"

Now the interface language of collabora is independent of your seafile ui language. In my case it is only German (Switzerland).

Probably this will be customizable in the future.

Yea this was still bothering me! Your fix works well for me :slight_smile: Thanks very much!