question: separate X and console localization

  • This topic has 8 replies, 4 voices, and was last updated Jul 18-1:15 pm by Brian Masinick.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #37040
    Anonymous

      By default, the same locale applies to both GUI and console.
      Since unicode support in console is bad enough to not use it, is it possible to have GUI localized whereas have console entirely in English?

      #37042
      Forum Admin
      anticapitalista
        Helpful
        Up
        0
        ::

        As far as I know it is not possible for window managers.
        You probably need to install a desktop-environment to do this.

        Philosophers have interpreted the world in many ways; the point is to change it.

        antiX with runit - leaner and meaner.

        #37191
        Anonymous
          Helpful
          Up
          0
          ::

          proof of concept: parallel launch:
          $ geany
          $ env LANG=uk_UA.UTF-8 geany
          $ env LANG=zh_CN.UTF=8 geany

          But a single example is not the same as the whole desktop…
          Should something like this work in theory?
          Will it work in practice?

          #37194
          Member
          sybok
            Helpful
            Up
            0
            ::

            @proof of concept:
            Then you can have the desktop set to your “preferred” language and create a keyboard and/or desktop shortcut to launch a console (via executing the below script)

            #!/bin/bash
            #current=<get current locale> # variable
            current="$(locale | grep 'LANG=' | awk -F'=' ' { print $2 } ' | xargs)"
            console=<console locale> # constant
            env "LANG=${console}" <your favorite terminal application> &; env "LANG=${current}"

            with re-settting ‘env’ after the terminal is launched may not be necessary (needs to be tested).

            • This reply was modified 2 years, 11 months ago by sybok. Reason: Improved the code comments
            #37196
            Forum Admin
            anticapitalista
              Helpful
              Up
              0
              ::

              There might be a way to do this via setting locale (export) in ~/.bashrc or ~/.profile or /etc/bash.bashrc

              Philosophers have interpreted the world in many ways; the point is to change it.

              antiX with runit - leaner and meaner.

              #37197
              Member
              sybok
                Helpful
                Up
                0
                ::

                @anticapitalista:
                Yes, that’s much simpler than my original proposal.

                (Strange, I did that today in the morning to setup a (language+)encoding on a mail server I use in order to display some Czech characters correctly and I did not mention it here…)

                In my case, I have added these two lines to my ‘~/.bashrc’

                export LC_ALL=en_US.utf8
                export LANG="$LC_ALL"
                • This reply was modified 2 years, 11 months ago by sybok.
                #38975
                Anonymous
                  Helpful
                  Up
                  0
                  ::

                  let me share my observations:

                  1. GRUB speaks your default language, so it will not be in English
                  2. When an app launches another app, the 2’nd one may inherit the language of the 1’st one. For example, antiX updates icon that sits in the system tray launches GUI window and then terminal window which content will not be in English

                  I have switched default to English and run selected apps via env LC_ALL=

                  #39087
                  Moderator
                  Brian Masinick
                    Helpful
                    Up
                    0
                    ::

                    By default, the same locale applies to both GUI and console.
                    Since unicode support in console is bad enough to not use it, is it possible to have GUI localized whereas have console entirely in English?

                    I should have communicated earlier.

                    Unless the Linux behavior is different from the UNIX behavior, whatever locale used to login will be the default locale for every application. You can, however, override any environment variable necessary to run a specific application in another locale.

                    For example LANG=C xterm
                    will start xterm in the default locale regardless of the other environment settings and you can prepend LANG or another environment variable to any commands and you can put these in a script or login configuration.

                    .bashrc is a legitimate place to set different locale information or you can source any executable script as needed and it will work during the current login.

                    --
                    Brian Masinick

                    #39088
                    Moderator
                    Brian Masinick
                      Helpful
                      Up
                      0
                      ::

                      By default, the same locale applies to both GUI and console.
                      Since unicode support in console is bad enough to not use it, is it possible to have GUI localized whereas have console entirely in English?

                      Short answer is yes.

                      --
                      Brian Masinick

                    Viewing 9 posts - 1 through 9 (of 9 total)
                    • You must be logged in to reply to this topic.