Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-04-13 20:03:24

twijg
Member
Registered: 2022-04-13
Posts: 2

Localize panel plugin clock differently than rest of system

Hi,

I can't seem to find anyone who tried to do this before. My system locale is English, which I like but I recently started using the fuzzy time option from the xfce4-panel clock plugin and would really like that to be in an other language (Dutch). I set LC_MESSAGES in /etc/locale.conf to nl_NL but that changed the language of the whole system. Is there a way to use that plug-in with a different locale than the rest of the system?

Thanks in advance,
Twijg

Last edited by twijg (2022-04-13 20:03:36)


openSUSE Tumbleweed

Offline

#2 2022-04-14 05:28:42

KBar
Moderator
Registered: 2021-11-05
Posts: 689

Re: Localize panel plugin clock differently than rest of system

Hello and welcome.

What's the version of your xfce4-panel?

xfce4-panel --version

The clock plugin is internal and I don't think you can force a different locale on individual plugins. What you can, however, is try to load the panel with a different locale.

xfce4-panel --quit # kills the active instance
LC_MESSAGES=nl xfce4-panel # start a new one with language set to Dutch.

That should work.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#3 2022-04-14 15:26:50

twijg
Member
Registered: 2022-04-13
Posts: 2

Re: Localize panel plugin clock differently than rest of system

Thank you for your reply.
I'm using version 4.16.3 of the panel on openSUSE. Quitting the panel, setting the locale (with nl_NL or nl_BE) and starting it works, thank you.
Is there a way to just start it in dutch in the first place instead of quitting it and starting it again?
(I could write a script to quit and restart it automatically on login but would  prefer it to just start correctly of course).

If I have some free time in the future, I might just write a dutch fuzzy time script myself and use genmon to display it. That would solve it too :)

Last edited by twijg (2022-04-14 15:35:55)


openSUSE Tumbleweed

Offline

#4 2022-04-14 16:16:49

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,992

Re: Localize panel plugin clock differently than rest of system

twijg wrote:

If I have some free time in the future, I might just write a dutch fuzzy time script myself and use genmon to display it. That would solve it too smile

This bash fuzzy clock script already exists. Its missing an NL translation, but perhaps you can add one. Then the output can be redirected to genmon.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2022-04-14 16:23:29

KBar
Moderator
Registered: 2021-11-05
Posts: 689

Re: Localize panel plugin clock differently than rest of system

xfce4-panel is started by xfce4-session after xfwm4 and xfsettingsd.

You can create a wrapper in your home directory and invoke the panel from within it. On most Debian-based systems, the .profile is set to include user's private bin directories if they exist. These are $HOME/bin and $HOME/.local/bin. If they are not set to be included in your .profile, then simply append this piece of code:

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

Create a file named xfce4-panel in either of the directories with the following content:

#!/bin/sh
LC_MESSAGES=nl_NL /usr/bin/xfce4-panel

Notice the full pathname. It it were simply xfce4-panel. then the script would run itself recursively forever until it exhausts the system resources.
Don't forget to grant execute permissions to the script with:

chmod +x ~/bin/xfce4-panel

Reboot to test.

Last edited by KBar (2022-04-14 16:25:10)


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#6 2024-02-10 02:18:02

domecq
Member
Registered: 2024-02-10
Posts: 7

Re: Localize panel plugin clock differently than rest of system

Hello,

I noticed that this post has no new messages since almost two years ago but since I am having exactly the same problem described here, I opted to use it rather than opening a new one that could be considered a duplicate.

My system is all set in French but the weekday in the tooltip format and the calendar that appears underneath the clock, they are in English.

It's worthy to note that the month shows up in French in the tooltip format. It's only the week day that is shown in English there.

The version of xfce4-panel is 4.18.5 (Xfce 4.18).

Is there a way to fix this or is it a bug?

Offline

#7 2024-02-10 03:42:25

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,992

Re: Localize panel plugin clock differently than rest of system

Can you post back the outputs of:

localectl
locale

Everything should be properly translated for the clock widget.

french2.png

Are you starting xfce4-panel by setting a different LC_MESSAGES value as per below?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#8 2024-02-10 15:33:53

domecq
Member
Registered: 2024-02-10
Posts: 7

Re: Localize panel plugin clock differently than rest of system

I apologize. I should have read the documentation of the system I use before asking this question here.

From that documentation I realized that this is a caveat in its locale that appears to have nothing to do with Xfce.

I thank you anyway.

Cheers.

Offline

#9 2024-02-18 16:38:39

domecq
Member
Registered: 2024-02-10
Posts: 7

Re: Localize panel plugin clock differently than rest of system

I apologize again for another post. I believe the following is still related to the subject and I thought XFCE team might like to have a look at it.

The following link presents some messages discussing the issue in this subject from the perspective of OpenBSD (the system I use):

https://marc.info/?l=openbsd-misc&m=162423003608201&w=2

In the second message in that thread, it was observed the following:

"OpenBSD's date(1) ignores your locale setting.
XFCE as a third-party application might choose to support it,
but that has nothing to do with the base date(1)."

Eventually, the person who initiated the discussion said he would bring this to XFCE devs' attention. I'm not sure if that was done and if it was, what was, I could not find any reference about it.

Taking this into account, I'd appreciate an advice on what can be done to tackle this issue.

Thank you.

Offline

#10 2024-02-18 20:57:52

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,992

Re: Localize panel plugin clock differently than rest of system

I'm somewhat confused as to what you are asking about. In your original post, you indicated some text around the clock applet was not showing in French. However, the link that you've provided seems to talk about date format from locale.

I've located this (maybe?) relevant bug report regarding the clock (GtkCalendar widget) and the time formatting.

I don't have access to an openbsd install, but I do have a freebsd VM, and on this VM, if I set LANG to "fr_FR.UTF-8" (and MM_CHARSET to "UTF-8"), I get proper localization and translation of the clock widget into French.

Can you confirm your issue? Feel free to open another bug report on Xfce's gitlab instance if you would like to have a developer look at the issue (he may drop by here as well).


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#11 2024-02-19 04:15:56

domecq
Member
Registered: 2024-02-10
Posts: 7

Re: Localize panel plugin clock differently than rest of system

I have configured the locale of my system to French. Programs interfaces, menus, are all in French.

FluxBB bbcode test

The issue that puzzles me is when I hover the mouse cursor over the time, it shows the week day in English followed by the day, month in French and year, as shown in the following screengrab:

FluxBB bbcode test

In addition, when I click on the time, the calendar shows up in English, as shown in the following image:

FluxBB bbcode test

These are the locales available in my system:
locale -a
C
C.UTF-8
POSIX
POSIX.UTF-8
Pig.UTF-8
ar_SD.UTF-8
ar_SY.UTF-8
ca_ES.UTF-8
cs_CZ.UTF-8
da_DK.UTF-8
de_AT.UTF-8
de_CH.UTF-8
de_DE.UTF-8
el_GR.UTF-8
en_AU.UTF-8
en_CA.UTF-8
en_GB.UTF-8
en_US.UTF-8
es_AR.UTF-8
es_BO.UTF-8
es_CH.UTF-8
es_CO.UTF-8
es_CR.UTF-8
es_CU.UTF-8
es_DO.UTF-8
es_EC.UTF-8
es_ES.UTF-8
es_GQ.UTF-8
es_GT.UTF-8
es_HN.UTF-8
es_MX.UTF-8
es_NI.UTF-8
es_PA.UTF-8
es_PE.UTF-8
es_PR.UTF-8
es_PY.UTF-8
es_SV.UTF-8
es_US.UTF-8
es_UY.UTF-8
es_VE.UTF-8
fa_IR.UTF-8
fi_FI.UTF-8
fr_BE.UTF-8
fr_CA.UTF-8
fr_CH.UTF-8
fr_FR.UTF-8
hu_HU.UTF-8
hy_AM.UTF-8
is_IS.UTF-8
it_CH.UTF-8
it_IT.UTF-8
ja_JP.UTF-8
ko_KR.UTF-8
lt_LT.UTF-8
nl_BE.UTF-8
nl_NL.UTF-8
no_NO.UTF-8
pl_PL.UTF-8
pt_PT.UTF-8
ro_RO.UTF-8
ru_RU.UTF-8
sk_SK.UTF-8
sl_SI.UTF-8
sv_SE.UTF-8
tr_TR.UTF-8
uk_UA.UTF-8
zh_CN.UTF-8
zh_TW.UTF-8

My .profile has the following lines:
export LC_MESSAGES=fr_FR.UTF-8
export LC_CTYPE=fr_FR.UTF-8
export LC_TIME=fr_FR.UTF-8

But as per the discussion in the thread that I mentioned, if I understood it correctly, only LC_MESSAGES seems to take the locale fr_FR.UTF-8 since the date function seems to perform only with locale en_US.UTF-8 and there seem to be a feature missing in that xfce plugin that puts the week day and the calendar in French.

Is this issue then the case of entering a bug report?

Offline

#12 2024-02-19 12:57:18

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,992

Re: Localize panel plugin clock differently than rest of system

domecq wrote:

Is this issue then the case of entering a bug report?

If you wish.

Out of curiosity, what are you only setting some locale elements (LC_MESSAGES, LC_TIME, LC_CTYPE) instead of just LANG="fr_FR.UTF-8"? What does "locale" on your system return?

I have configured the locale of my system to French.

How?

As a note of comparison, if I set my .xinitrc file to look like this (slim as DM):

LANG="fr_FR.UTF-8"
MM_CHARSET="UTF-8"
exec xfce4-session

...everything is properly translated to French.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#13 2024-02-19 22:09:05

domecq
Member
Registered: 2024-02-10
Posts: 7

Re: Localize panel plugin clock differently than rest of system

ToZ wrote:

Out of curiosity, what are you only setting some locale elements (LC_MESSAGES, LC_TIME, LC_CTYPE) instead of just LANG="fr_FR.UTF-8"? What does "locale" on your system return?

LANG=
LC_COLLATE="C"
LC_CTYPE=fr_FR.UTF-8
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES=fr
LC_ALL=

ToZ wrote:

How?

I followed the suggestion in the following page:

https://doc.huc.fr.eu.org/fr/sys/openbsd/tip-fr-lang/

Offline

#14 2024-02-19 22:31:52

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,992

Re: Localize panel plugin clock differently than rest of system

domecq wrote:

I followed the suggestion in the following page:

https://doc.huc.fr.eu.org/fr/sys/openbsd/tip-fr-lang/

https://docs.freebsd.org/en/books/handbook/l10n/ suggests setting the LANG and MM_CHARSET values. I notice LANG is not set on your system. If I set it on mine, I don't have issues with french translation.

If you instead just set LANG and MM_CHARSET as indicated in the freebsd documentation, does this solve your issue? And/or does it cause other issues?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#15 2024-02-20 01:45:35

domecq
Member
Registered: 2024-02-10
Posts: 7

Re: Localize panel plugin clock differently than rest of system

Toz wrote:

If you instead just set LANG and MM_CHARSET as indicated in the freebsd documentation, does this solve your issue? And/or does it cause other issues?

I did not notice another issue. Thank you but, no, this did not solve the issue.

It's worth to note the following:

OpenBSD documentation on Character Sets and Localization
The OpenBSD base system fully supports the ASCII character set and encoding, and partially supports the UTF-8 encoding of the Unicode character set. No other encodings or character sets are supported by the base system, but ports can be used to handle them. The level of UTF-8 support and the default encoding configuration vary greatly with the program or library.

To use the Unicode character set in UTF-8 encoding wherever supported, set the LC_CTYPE environment variable to the value en_US.UTF-8:

    If logging in via xenodm(1), add export LC_CTYPE="en_US.UTF-8" to your ~/.xsession before starting the window manager. See customizing X for more details.
    If logging in via the text console, add export LC_CTYPE="en_US.UTF-8" to your ~/.profile. The text console's UTF-8 support is a work in progress, and some non-ASCII characters may not display properly.

When logging into remote systems with ssh(1), the LC_CTYPE environment variable is not propagated, and you have to make sure that the local terminal is set to the character encoding used by the remote server before connecting. If that encoding is unknown or unsupported by OpenBSD, make sure you use the default xterm(1) configuration and set LC_CTYPE=en_US.UTF-8 in the remote shell after connecting.

The OpenBSD base system completely ignores all locale-related environment variables except LC_CTYPE; even LC_ALL and LANG only affect the character encoding. Some ports may respect other LC_* variables, but using them or setting LC_CTYPE to any value other than C, POSIX or en_US.UTF-8 is not recommended.

And, considering the following, there seems to be a need of XFCE to support:

In the thread that I mentioned a few posts above, it is noted:

( ... )
man locale

        Programs in the OpenBSD base system ignore the locale except
        for the character encoding, and it is not recommended to
        use any of these variables except that the following
        non-default setting is supported as an option:

    export LC_CTYPE=en_US.UTF-8

OpenBSD's date(1) ignores your locale setting.
XFCE as a third-party application might choose to support it,
but that has nothing to do with the base date(1).

The person who initiated that thread had this issue with his locale in Spanish.

Last edited by domecq (2024-02-20 01:47:30)

Offline

#16 2024-02-20 02:32:35

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,992

Re: Localize panel plugin clock differently than rest of system

I see. Perhaps a bug report is the next best step forward. Feel free to create one at https://gitlab.xfce.org/xfce/xfce4-panel/-/issues. Perhaps a developer can shed some light on this issue.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#17 2024-02-20 02:40:30

domecq
Member
Registered: 2024-02-10
Posts: 7

Re: Localize panel plugin clock differently than rest of system

Cool, thank you.

Offline

Board footer

Powered by FluxBB