Page 1 of 7 123 ... LastLast
Results 1 to 10 of 61

Thread: How do I set locale

  1. #1

    Default How do I set locale

    Hi!

    When I update the system, I get get a warning after certain packages have been installed (e.g. LibreOffice, VLC etc) that says:

    Code:
    /etc/profile.d/lang.sh: line 80: warning: setlocale: LC_COLLATE: cannot change locale (en_DE.UTF-8): no such file or directory
    /etc/profile.d/lang.sh: line 76: warning: setlocale: LC_CTYPE: Cannot change locale (en_DE.UTF-8): no such file or directory
    When I click on a odt-file named
    HTML Code:
    Att göra.odt
    to open it with LibreOffice, I'm informed that the file named
    HTML Code:
    Att g??ra.odt
    does not exist.
    However, I can open the file with Calligra.

    Any advice in how I can set locale?

    I'm on Tumbleweed, KDE Frameworks 5.36.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    22,131

    Default Re: How do I set locale

    I am not sure that I understand all of what is going on in this area. Thus some observations that may help or not.

    The problem you see with the incorrect interpreted file name is IMHO not so much about locale, but about character encoding. All file names in Linux should be encoded in UTF-8 since already a long time. Apparently some software here interprets the name as having another encoding.

    The expression en_DE in your variables is a bit strange. I would expect de_DE for German as used in Germany. As you show it, it is English as used in Germany. I have no idea what the meaning is in this particular case and if many programs will support it. For me it is much clearer what e.g. en_AU means: English as used in Australia.
    Henk van Velden

  3. #3

    Default Re: How do I set locale

    Thanks for helping out!

    I found in KDE's System settings -> Personalization -> Regional settings, that I have set:
    - Language: American English
    - Formats: Region Germany - English (en_DE)

    From what I understand, having chosen en_DE means that the format for numbers, currency, date and time etc will be according to German customs, but the content written in English. For example, here's the difference between three different formats:

    Code:
    en_US:
    Time: Sunday, August27, 2017 3:02 PM
    Currency: 24 €
    
    en_DE: 
    Time: Sunday, 27 August 2017 15.02  
    Currency: $24
    
    de_DE:
    Time: Sonntag, 27. August 2017 15.02
    Currency: 24 €
    In other words, I want to read in English, but the content formatted according to German customs.
    This is the only place where I've found that en_DE is being used.

    YAST
    I've also found in YAST -> System -> Language, that I have "English (US)" set as primary language.
    When I click Details -> Detailed Locale Setting, I can further choose between a number of locales, such as en_AU, en_GB, en_NZ etc.

    If I switch primary language to "German - Deutsch", and then click on Details -> Detailed Locale Setting, I can choose between de_AT, de_BE etc, but there is no en_DE.

    Final note, in YAST -> System -> etc/sysconfig Editor -> System -> Environment -> Language, there are a bunch of settings, among others RC_LANG, RC_LC_CTYPE and RC_LC_COLLATE.

    Since I don't know what they stand for, I haven't dared to experiment changing them. Under RC_LANG there is a explanation that goes:

    Code:
    File: /etc/sysconfig/language
    
    Possible Values: POSIX, ca_ES.ISO-8859-1, ca_ES.UTF-8, cs_CZ.ISO-8859-2, cs_CZ.UTF-8, da_DE@euro, da_DK.ISO-8859-1, da_DK.UTF-8, de_DE@euro, de_DE.ISO-8859-1, de_DE.UTF-8, el_GR.ISO-8859-7, el_GR.UTF-8, en_GB.ISO-8859-1, en_GB.UTF-8, en_IE@euro, en_IE.ISO-8859-1, en_US.ISO-8859-1, es_ES@euro, es_ES.ISO-8859-1, es_ES.UTF-8, fr_FR@euro, fr_FR.ISO-8859-1, fr_FR.UTF-8, gl_ES@euro, gl_ES.ISO-8859-1, gl_ES.utf-8, hr_HR.ISO-8859-2, hu_HU.ISO-8859-2, hu_HU.UTF-8, it_IT@euro, it_IT.ISO-8859-1, it_IT.UTF-8, ja_JP.eucJP, ja_JP.UTF-8, lt_LT.ISO-8859-13, lt_LT.UTF-8, nl_NL@euro, nl_NL.ISO-8859-1, nl_NL.UTF-8, ru_RU.ISO-8859-5, ru_RU.KOI8-R, ru_RU.UTF-8, sk_SK.ISO-8859-2, sk_SK.UTF-8, tr_TR.ISO-8859-9, tr_TR.UTF-8, ko_KR.eucKR, ko_KR.UTF-8, zh_TW.Big5, zh_TW.UTF-8, zh_CN.GB2312, zh_CN.UTF-8 or any value
    
    Default Value: 
    
    Configuration Script: OpenOffice.org, groff, ispell, kde, kdm, profiles, susehelp, susewm, tetex, wdm
    
    Description: 
    Local users will get RC_LANG as their default language, i.e. the
    environment variable $LANG . $LANG is the default of all $LC_*-variables,
    as long as $LC_ALL is not set, which overrides all $LC_-variables.
    Root uses this variable only if ROOT_USES_LANG is set to "yes"
    Currently RC_LANG is set to en_US.UTF-8.

    Hope the above is of any help. Any further thoughts/advice is much appreciated!

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    22,131

    Default Re: How do I set locale

    You are correct about the mix of one language with characteristics of another that is defined in expressions like en_DE.

    I am not sure that each and every application will honour such definitions, but KDE might do it.

    I also guess you are correct in all your other explanations about the LC_* variables. But as I said in my first post here, I doubt that those has anything to do with your problem. All those are basically about using a certain language and formatting according to the habits of certain region of output.

    To put it short: your problem has nothing to do with locale.

    You are not complaining about a program that uses the wrong language or format when it wants to tell you something, you are talking about a file name, that is in UTF-8 encoding on your system (coded as such in the directory where it lives in), and that is correct "decoded" by some programs, but wrongly done by at least one other program.
    You could start by seeing yourself how it is in the directory with
    Code:
    ls -l <path/to/the/file>
    (where you of course have to replace<path/to/the/file> with the correct path).

    I will try to recreate your problem on Leap 42.2 (no TW available).
    I tried already on 13.1, but no problem there.
    Henk van Velden

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    22,131

    Default Re: How do I set locale

    This is what I did on a 42.2 (LibreOffice 5.3.3.2).

    Start Writer and created a small document. Stored it as test.odt.

    From the CLI made a copy
    Code:
    cp test.odt töst.odt

    Started Dolphin and surfed to the directory.
    Clicked on töst.odt
    Result: LO started and opened the document.

    Thus I can not recreate it, or I am doing something different from what you do.
    Henk van Velden

  6. #6

    Default Re: How do I set locale

    Quote Originally Posted by hcvv View Post
    You are... <snip>
    To put it short: your problem has nothing to do with locale.

    You are not complaining about a program that uses the wrong language or format when it wants to tell you something, you are talking about a file name, that is in UTF-8 encoding on your system (coded as such in the directory where it lives in), and that is correct "decoded" by some programs, but wrongly done by at least one other program.
    Ah, got you!

    Quote Originally Posted by hcvv View Post
    You could start by seeing yourself how it is in the directory with
    Code:
    ls -l <path/to/the/file>
    (where you of course have to replace<path/to/the/file> with the correct path).
    Here's the output from the command:

    Code:
    bv@linux-0xse:~> ls -l /home/bv/Documents/Att_göra.odt
    -rw-r--r-- 1 bv users 11818 Jan  3  2017 /home/bv/Documents/Att_g??ra.odt
    So, my system can't read certain characters even though I'm using UTF-8 encoding.
    I'm still wondering why the warning is that there is no such file as "en_DE". Are odd characters, such as "å ä ö" part of en_US.UTF-8? (I don't know if that's a relevant/meaningful question to ask - "I'm a dentist by profession" so to speak

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    22,131

    Default Re: How do I set locale

    Short before going to sleep.

    My first reaction: this is ridiculous.
    I hope I can come to a better conclusion tomorrow. Or of course there may be others that understand it.
    Henk van Velden

  8. #8

    Default Re: How do I set locale

    did you change your locale with yast or edited /etc/profile because changing your language in plasma 5 settings is a per user config and installing with zypper (rpm) is done as root so root should not really see your de_EN setting?
    another thing is that bash is not really dependent on plasma 5 settings and should see extra latin chars afaik you don't need utf8 for those as they're part of the extended ascii char set
    now if you tweaked something in yast or changed a system wide setting strange things will happen


    ps
    I remember a similar issue with cyrilic and windows as cmd.exe uses a specific font that does not have the char for the letter ј (it's not lattin j) so instead it prints out ? a file named боја.txt is printed out бо?а.txt I'm speculating you changed the default font in konsole to a one that does not have the extra latin gliphs?

  9. #9

    Default Re: How do I set locale

    a few more thoughts
    en_DE is meaningless you can set american english (or canadian) as the default language for plasma 5 and the region Deutschland but that would still use en_US (or en_CA) locale there is no en_DE locale because en_US is not the same as en_CA or en_UK unlike deutsch english is not quite the same world wide what would be the setting if you chose British English en_UK_DE?
    there is flow in your logic

    did you maybe start plasma 5 as root?

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    22,131

    Default Re: How do I set locale

    Got some sleep, and thus got an idea.
    Code:
    henk@boven:~/test> LANG=de_DE.UTF-8 ls
    a::b       chars  lönekonto  phptest  py      sp      stderr  t-chown     wdir
    bestanden  ctest  oo         plaatje  red     sparkz  stdout  unicode     Лшадсщ
    ccc        file   photos     ps       script  spsp    sw      urlmetraar  नमस्ते
    henk@boven:~/test> LANG=en_DE.UTF-8 ls
    a::b       chars  l??nekonto  phptest  py      sp      stderr  t-chown     wdir
    bestanden  ctest  oo          plaatje  red     sparkz  stdout  unicode     ????????????
    ccc        file   photos      ps       script  spsp    sw      urlmetraar  ??????????????????
    henk@boven:~/test>
    As you see here, the en_DE gives that bad results.

    Thus a apologize for saying that the locale is not the problem.

    The LANG variable en_DE.UTF-8 apparently formats the output as if UTF-8 is NOT part of it and uses a different encoding.

    Now, which component to blame (and to submit a bug against)?

    I am not with I_A. While it looks at first that en_US, en_AU, en_EN, etc. and fr_FR, fr_CN etc. make sense and en_DE does not, this is not the case.

    As explained in posts a bit more up. en_DE means to use the English language, but use DE (Germany) as the regio, which means e.g.that English language is used for messages, but that numbers and the like are formatted according to DE habits. 10,000,000.00 vs. 10'000'000,00.

    Not used by many, but something expats may love it.
    There are definitions for this. See e.g. https://gist.github.com/heftig/4740516


    The problem seems to be that the UTF-8 part is not correctly interpreted here.

    And see this:
    Code:
    henk@boven:~/test> ls Лшадсщ
    Лшадсщ
    henk@boven:~/test> LANG=C ls Лшадсщ
    ????????????
    henk@boven:~/test> LANG=C.UTF-8 ls Лшадсщ
    ????????????
    henk@boven:~/test>
    Last edited by hcvv; 28-Aug-2017 at 00:54.
    Henk van Velden

Page 1 of 7 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •