Hi! I have installed NixOS for the first time. I am from Sweden and have issues with swedish language support in LibreOffice. I have installed 10 common apps including OnlyOffice and every app have support for swedish language except from LibreOffice. Is there a way to add swedish support in LibreOffice, a config?
Maybe import this module and change every occurrence of “de” by “sv”? This brings spell checking and hyphenation to Libreoffice and other programs. If I remember correctly, the menus of libre office were German in my case automatically.
PS: Welcome on this Discourse!
Thanks for your reply.I have installed NixOS with KDE Plasma. Evewrything is in swedish language except from LibreOffice. All my menus in LibreOffice are in American english. There are more language included in “pkgs.libreoffice”, like french, german, spanish, italian, esperanto etc. But not swedish.
My question was more about how to get Swedish menus in LibreOffice. Is there a libreoffice-menu-file? Where? Can I use AI-tool to translate that english language menu file to swedish?
As an exapmple: My main distro is Arch. I use the arch-package “libreoffice-sv” to install LibreOffice with full swedish language support. In Debian I first have to install libreoffice, then I install a second package called “libreoffice-l10n-sv”
Hi again! I used /etc/nixos/configuration.nix to add support for spelling. And it works.See further down! But I miss a package for language support as I said before.
environment.systemPackages = [
pkgs.libreoffice
pkgs.hunspell
pkgs.hunspellDicts.sv_SE
pkgs.hyphen
pkgs.hyphenDicts.sv-se
];
libreoffice has a langs argument that probably is meant to be overridden for this.
Not sure about the various other expressions -bin -qt etc.
also check that LANG / locale is set correctly. You can test e.g. LANG=es_ES.utf8 libreoffice to see if it can pick up Spanish for you.
This list has been expanded over the years by people adding locales as needed in various PRs (all locales were not included to keep the closure size down). I recommend that OP does the same here (or open an issue).
Be forewarned that LibreOffice is a taxing build, it took Hydra one hour looking at a recent build. Quoting from the LibreOffice Wiki[1]
Be aware that full (all components, non-incremental) build may take up to 24 hours and takes up about 20 GB of drive space. You will also most likely need at least 8 GBs of RAM, otherwise the machine might fall into swap and appear to freeze up.
Because the languages are part of the binary derivation, a rebuild will be required.
although I think that the quote is somewhat out of date, the general message is still true. ↩︎
Thanks for your reply. The list shows that the swedish language “sv” is not included in libreoffice for NixOS. That is a shame. Why should I test the spanish language? I am from Sweden. Spanish is by the way already supported in libreoffice, see “es”!
Thanks for your reply. NixOS is an european distro. That is one reason I choose to try it. Many european authorities in Europe are interested in this distro and want to replace Windows 11. If the team around NixOS want its distro to be more popular and make money it is essential to support more languages, especially european ones. LibreOffice is the most popular app besides Firefox in the Linux world. LibreOffice in NixOS should work out of the box without any issues.
The swedish language pack for libreoffice in Debian is 825,6 kbyte. Less than 1 MB. What is the problem for NixOS? See link: I Challenge Thee
NixOS is not a “european distro”, and including every language would not make sense by default, so some of the most popular languages were picked. Sweden is not even top 50 in terms of population, so it would not make sense to prioritize it over the other 90 countries that are bigger. Still, you have the option to override the language used as described earlier.
Of course if you have a PR that can improve the architecture of how LO languages are handled in nixpkgs, feel free to send it.
It is partly due to differences in packaging methodology. Debian has individual packages (per language) for internationalisation and for the language specific help files.
The way it is packaged in NixOS is different, you get all the languages specified in the derivation. Ideally we would do as Debian has, but we have not done that yet.
One reason for this is that maintenance is performed by volunteers with limited time and resources available. LibreOffice currently only has one maintainer.
When looking at the size of the file as you have done, you should also look at the language specific help files too. It is circa 30MB for one language alone. Including that for all languages really bumps the closure size up.
Thanks for your reply! Excerpt from Wikipedia:
The NixOS Foundation, a Dutch non-profit established in 2015, supports the development and community infrastructure of NixOS and related Nix projects.
Is Wikipedia wrong? Dutch people live in Europe as far as I know.
Thanks for you reply and understanding! I think that NixOS has to learn from other distros like Debian about internationalisation. The packages in NixOS gets too big with all langs in one package and it takes time for users too download and update. NixOS servers also have to work more. But the biggest problem is that there are too few maintainers. Only one for libreoffice explains why there is an issue. I am a little bit surprised about that. I thought NixOS was “bigger” with more maintainers.
The NixOS Foundation, a Dutch non-profit established in 2015, supports the development and community infrastructure of NixOS and related Nix projects.
Reread your sentence, NixOS Foundation is not NixOS or nixpkgs
It’s certainly also not made for europeans as you seem to believe.
If you want to step up, you’re welcome to. For now, you must override the package.
As you are newcomer I guess you don’t know what override a package means.
tldr, you have 3 options to use Sweden in libreoffice
Option 1, write something like this (this is called “override the package”. libreoffile is a relatively big program and it has a wrapper, so the overriding procedure is more complicated than normal package):
environment.systemPackages = [
# pkgs.libreoffice # <======= comment out this line, replace with below
(pkgs.libreoffice.override (prev: {
unwrapped = prev.unwrapped.override {
langs = [
"ar"
"ca"
"cs"
"da"
"de"
"en-GB"
"en-US"
"eo"
"es"
"fi"
"fr"
"hu"
"it"
"ja"
"ko"
"nl"
"pl"
"pt"
"pt-BR"
"ro"
"ru"
"sk"
"sl"
"sv" # <========== Your language added here
"tr"
"uk"
"zh-CN"
"zh-TW"
];
};
}))
];
(My skill issue not so good this is the best I can think of)
Then compile libreoffice (maybe for about 24 hours as people mentioned above), then you can use your language in libreoffice.
If you don’t want to compile every time nixpkgs update it, you can even pin libreoffice so it just follow an arbitrary commit of nixpkgs so its version don’t change, so it won’t update anymore, no more compiling.
Option 2: open a PR and add "sv" on the list.
Option 3: open a PR to make adding a language like above (option 1) won’t trigger a massive rebuild (maybe a wrapper inside a wrapper? IDK, sounds very complicated to me)
Why a wrapper in the wrapper?
I do not know how exactly LOo and OOo do discover the “installed” language packs, though in my imagination, it should be possible to make the language packs a matter of the wrapper directly, without an additional layer being introduced.
I would even take a look at it, if my knowledge about the LOo/OOo internals were better and I had a machine that doesn’t lock me out for 5 days when compiling coreutils…
Thank for your explanation. I use an old Thinkpad T420 so compiling is out of question
My solution was to enable flatpak and install libreoffice as a flatpak. Now I have full Swedish language support. It took 3 minutes (instead of 24 hours). For me is the subject closed now.
Nice, NixOS is always full of options