KDE do not works with custom locale

Hi everyone!
TL;DR: custom locale doesn’t work with KDE apps. Details below:

I created a custom locale file I copied /usr/share/i18n/locales/hu_HU to /usr/share/i18n/locales/en_HU

And I modified only the LC_TIME section:

LC_TIME
abday   "Sun";"Mon";"Tue";"Wed";"Thu";"Fri";"Sat"
day     "Sunday";/
        "Monday";/
        "Tuesday";/
        "Wednesday";/
        "Thursday";/
        "Friday";/
        "Saturday"
abmon   "Jan";"Feb";/
        "Mar";"Apr";/
        "May";"Jun";/
        "Jul";"Aug";/
        "Sept";"Oct";/
        "Nov";"Dec"
mon     "January";/
        "February";/
        "March";/
        "April";/
        "May";/
        "June";/
        "July";/
        "August";/
        "September";/
        "October";/
        "November";/
        "December"
d_t_fmt "%Y. %b. %-e., %A, %H:%M:%S %Z"
d_fmt   "%Y-%m-%d"
t_fmt   "%H:%M:%S"
am_pm   "";""
t_fmt_ampm "%H:%M:%S"
date_fmt "%Y. %b. %-e., %A, %H:%M:%S %Z"
week     7;19971130;4
first_weekday   2
END LC_TIME

then

sudo localedef -i en_HU -f UTF-8 en_HU.UTF-8

then
I manually added the following to /etc/locale.gen :

en_HU.UTF-8 UTF-8

then

sudo locale-gen

It returned something like this:

en_HU.UTF-8...done

then changed the LC_TIME=en_HU.UTF-8 in /etc/locale.conf and in /etc/default/locale .

Then rebooted the system.

In konsole the date commands returns the wanted format.

The problem is, my KDE apps like dolphin, Digital CLock widget, etc uses en_US locale for time. And there is no option for en_HU in the GUI settings.
If I set LC_TIME to en_GB or something non-custom locale, then every KDE app use those locales.
So the question is:
What am I missing or what I did wrong?

You could try manually editing ~/.config/plama-localerc, but at your own risk, and I would recommend that…

  1. you make a backup copy of it first; and…
  2. you do it in a tty, while completely logged out of Plasma.

I do not really wish to do that, because non-custom locales works without any modification of this file.

Well, then all I can do is point you toward this tutorial below. :arrow_down:

Beyond that, my hands are tied. :man_shrugging:

Thanks for the additional information.
It seems to me the KDE do not read changes in locale.

localectl
System Locale: LANG=en_US.UTF-8
               LC_NUMERIC=hu_HU.UTF-8
               LC_TIME=en_HU.UTF-8
               LC_MONETARY=hu_HU.UTF-8
               LC_PAPER=hu_HU.UTF-8
               LC_NAME=hu_HU.UTF-8
               LC_ADDRESS=hu_HU.UTF-8
               LC_TELEPHONE=hu_HU.UTF-8
               LC_MEASUREMENT=hu_HU.UTF-8
               LC_IDENTIFICATION=hu_HU.UTF-8
    VC Keymap: hu
   X11 Layout: hu

and

locale -a
C
C.UTF-8
en_HU.utf8
en_US.utf8
hu_HU.utf8
POSIX

Maybe it is a bug

you may have forgotten the modify /etc/locale.gen accordingly before executing localegen

No i haven’t.

cat /etc/locale.gen | grep -v "^#"

en_US.UTF-8 UTF-8
hu_HU.UTF-8 UTF-8
en_HU.UTF-8 UTF-8

Ups - I missed that - sorry.

I cannot say what is out of phase - but you can use en_DK as a starting point for a custom file as this is a locale which is mixing elements.

cat /usr/share/i18n/locales/en_DK

Perhaps you just need to edit .config/plasma-localerc to contain

[Formats]
LANG=en_HU.UTF-8
1 Like

If I add my custom locale to this file as LC_TIME=en_HU.UTF-8 it still don’t work.
I even tried: Locale - ArchWiki 4.2

I installed gnome for science, I modified nothing else. It works with the gnome UI.

Thanks for the en_DK tip,

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.