Loading ...
Sorry, an error occurred while loading the content.

Patch 6.2.153

Expand Messages
  • Bram Moolenaar
    Patch 6.2.153 Problem: Win32: :lang german doesn t use German messages. Solution: Add a table to translate the Win32 language names to two-letter
    Message 1 of 11 , Nov 12, 2003
    View Source
    • 0 Attachment
      Patch 6.2.153
      Problem: Win32: ":lang german" doesn't use German messages.
      Solution: Add a table to translate the Win32 language names to two-letter
      language codes.
      Files: src/ex_cmds2.c


      *** ../vim-6.2.152/src/ex_cmds2.c Sun Nov 9 20:35:08 2003
      --- src/ex_cmds2.c Mon Nov 10 10:25:20 2003
      ***************
      *** 5477,5483 ****
      --- 5477,5521 ----
      if (what == LC_ALL)
      vim_setenv((char_u *)"LANG", name);
      if (what != LC_CTYPE)
      + {
      + #ifdef WIN32
      + char_u *mname = name;
      + int i;
      + static char *(mtable[]) = {
      + "afrikaans", "af",
      + "czech", "cs",
      + "german", "de",
      + "english_united kingdom", "en_gb",
      + "spanish", "es",
      + "french", "fr",
      + "italian", "it",
      + "japanese", "ja",
      + "korean", "ko",
      + "norwegian", "no",
      + "polish", "pl",
      + "russian", "ru",
      + "slovak", "sk",
      + "swedish", "sv",
      + "ukrainian", "uk",
      + "chinese_china", "zh_cn",
      + "chinese_taiwan", "zh_tw",
      + NULL};
      +
      + /* On MS-Windows locale names are strings like
      + * "German_Germany.1252", but gettext expects "de". Try
      + * to translate one into another here for a few supported
      + * languages. */
      + for (i = 0; mtable[i] != NULL; i += 2)
      + if (STRNICMP(mtable[i], name, STRLEN(mtable[i])) == 0)
      + {
      + mname = mtable[i + 1];
      + break;
      + }
      + vim_setenv((char_u *)"LC_MESSAGES", mname);
      + #else
      vim_setenv((char_u *)"LC_MESSAGES", name);
      + #endif
      + }

      /* Set $LC_CTYPE, because it overrules $LANG, and
      * gtk_set_locale() calls setlocale() again. gnome_init()
      *** ../vim-6.2.152/src/version.c Wed Nov 12 20:47:29 2003
      --- src/version.c Wed Nov 12 20:49:12 2003
      ***************
      *** 639,640 ****
      --- 639,642 ----
      { /* Add new patch number below this line */
      + /**/
      + 153,
      /**/

      --
      hundred-and-one symptoms of being an internet addict:
      8. You spend half of the plane trip with your laptop on your lap...and your
      child in the overhead compartment.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
    • Mikolaj Machowski
      ... ^ Don t work. m. -- LaTeX + Vim = http://vim-latex.sourceforge.net/ Vim-list(s) Users Map: (last change 12 Sep) http://skawina.eu.org/mikolaj/vimlist Are
      Message 2 of 11 , Nov 12, 2003
      View Source
      • 0 Attachment
        Dnia Wednesday 12 of November 2003 20:50, Bram Moolenaar napisał:
        > Patch 6.2.153
        > Problem: Win32: ":lang german" doesn't use German messages.
        > Solution: Add a table to translate the Win32 language names to
        > two-letter language codes.
        > Files: src/ex_cmds2.c
        >
        >
        > *** ../vim-6.2.152/src/ex_cmds2.c Sun Nov 9 20:35:08 2003
        > --- src/ex_cmds2.c Mon Nov 10 10:25:20 2003
        > ***************
        > *** 5477,5483 ****
        > --- 5477,5521 ----
        > if (what == LC_ALL)
        > vim_setenv((char_u *)"LANG", name);
        > if (what != LC_CTYPE)
        > + {
        > + #ifdef WIN32
        > + char_u *mname = name;
        > + int i;
        > + static char *(mtable[]) = {
        > + "afrikaans", "af",
        > + "czech", "cs",
        > + "german", "de",
        > + "english_united kingdom", "en_gb",
        ^
        Don't work.

        m.

        --
        LaTeX + Vim = http://vim-latex.sourceforge.net/
        Vim-list(s) Users Map: (last change 12 Sep)
        http://skawina.eu.org/mikolaj/vimlist
        Are You There?
      • Bram Moolenaar
        ... Eh, what doesn t work? -- hundred-and-one symptoms of being an internet addict: 15. Your heart races faster and beats irregularly each time you see a new
        Message 3 of 11 , Nov 13, 2003
        View Source
        • 0 Attachment
          Mikolaj Machowski wrote:

          > Dnia Wednesday 12 of November 2003 20:50, Bram Moolenaar napisa³:
          > > Patch 6.2.153
          > > Problem: Win32: ":lang german" doesn't use German messages.
          > > Solution: Add a table to translate the Win32 language names to
          > > two-letter language codes.
          > > Files: src/ex_cmds2.c
          > >
          > >
          > > *** ../vim-6.2.152/src/ex_cmds2.c Sun Nov 9 20:35:08 2003
          > > --- src/ex_cmds2.c Mon Nov 10 10:25:20 2003
          > > ***************
          > > *** 5477,5483 ****
          > > --- 5477,5521 ----
          > > if (what == LC_ALL)
          > > vim_setenv((char_u *)"LANG", name);
          > > if (what != LC_CTYPE)
          > > + {
          > > + #ifdef WIN32
          > > + char_u *mname = name;
          > > + int i;
          > > + static char *(mtable[]) = {
          > > + "afrikaans", "af",
          > > + "czech", "cs",
          > > + "german", "de",
          > > + "english_united kingdom", "en_gb",
          > ^
          > Don't work.

          Eh, what doesn't work?

          --
          hundred-and-one symptoms of being an internet addict:
          15. Your heart races faster and beats irregularly each time you see a new WWW
          site address in print or on TV, even though you've never had heart
          problems before.

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
          \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
          \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
        • Mikolaj Machowski
          ... Sorry, ts . ... E197 Space I think. m. -- LaTeX + Vim = http://vim-latex.sourceforge.net/ Vim-list(s) Users Map: (last change 13 Nov)
          Message 4 of 11 , Nov 13, 2003
          View Source
          • 0 Attachment
            Dnia Thursday 13 of November 2003 11:21, Bram Moolenaar napisał:
            > Mikolaj Machowski wrote:
            > > Dnia Wednesday 12 of November 2003 20:50, Bram Moolenaar napisa?:
            > > > Patch 6.2.153
            > > > Problem: Win32: ":lang german" doesn't use German messages.
            > > > Solution: Add a table to translate the Win32 language names to
            > > > two-letter language codes.
            > > > Files: src/ex_cmds2.c
            > > >
            > > >
            > > > *** ../vim-6.2.152/src/ex_cmds2.c Sun Nov 9 20:35:08 2003
            > > > --- src/ex_cmds2.c Mon Nov 10 10:25:20 2003
            > > > ***************
            > > > *** 5477,5483 ****
            > > > --- 5477,5521 ----
            > > > if (what == LC_ALL)
            > > > vim_setenv((char_u *)"LANG", name);
            > > > if (what != LC_CTYPE)
            > > > + {
            > > > + #ifdef WIN32
            > > > + char_u *mname = name;
            > > > + int i;
            > > > + static char *(mtable[]) = {
            > > > + "afrikaans", "af",
            > > > + "czech", "cs",
            > > > + "german", "de",
            > > > + "english_united kingdom", "en_gb",
            > >
            > > ^
            > > Don't work.
            >
            > Eh, what doesn't work?

            Sorry, 'ts'.
            :lang english_united kingdom
            E197
            Space I think.

            m.

            --
            LaTeX + Vim = http://vim-latex.sourceforge.net/
            Vim-list(s) Users Map: (last change 13 Nov)
            http://skawina.eu.org/mikolaj/vimlist
            Are You There?
          • Mike Williams
            ... Er, wouldn t that just mean you don t have the UK English locale installed? Works a charm for me. Mike -- Workaholic: Someone who favorite entertainment
            Message 5 of 11 , Nov 13, 2003
            View Source
            • 0 Attachment
              On 13 Nov 2003 at 11:28, Mikolaj Machowski wrote:

              > Sorry, 'ts'.
              > :lang english_united kingdom
              > E197
              > Space I think.
              >
              > m.

              Er, wouldn't that just mean you don't have the UK English locale
              installed? Works a charm for me.

              Mike
              --
              Workaholic: Someone who favorite entertainment is Monday morning.
            • Bram Moolenaar
              ... Current language: English_United Kingdom.1252 ... Current messages language: en_gb Only on Win32, of course. -- hundred-and-one symptoms of being an
              Message 6 of 11 , Nov 13, 2003
              View Source
              • 0 Attachment
                Mikolaj Machowski wrote:

                > Dnia Thursday 13 of November 2003 11:21, Bram Moolenaar napisaÅx:
                > > Mikolaj Machowski wrote:
                > > > Dnia Wednesday 12 of November 2003 20:50, Bram Moolenaar napisa?:
                > > > > Patch 6.2.153
                > > > > Problem: Win32: ":lang german" doesn't use German messages.
                > > > > Solution: Add a table to translate the Win32 language names to
                > > > > two-letter language codes.
                > > > > Files: src/ex_cmds2.c
                > [...]
                > > > Don't work.
                > >
                > > Eh, what doesn't work?
                >
                > Sorry, 'ts'.
                > :lang english_united kingdom
                > E197
                > Space I think.

                For me it works fine:

                :lang English_United Kingdom
                :lang
                Current language: "English_United Kingdom.1252"
                :lang messages
                Current messages language: "en_gb"

                Only on Win32, of course.

                --
                hundred-and-one symptoms of being an internet addict:
                22. You've already visited all the links at Yahoo and you're halfway through
                Lycos.

                /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
                \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
              • Mikolaj Machowski
                ... menu_english_united_kingdom.1252.vim menu_english_united_kingdom.ascii.vim m. -- LaTeX + Vim = http://vim-latex.sourceforge.net/ Vim-list(s) Users Map:
                Message 7 of 11 , Nov 13, 2003
                View Source
                • 0 Attachment
                  Dnia Thursday 13 of November 2003 12:12, Mike Williams napisał:
                  > On 13 Nov 2003 at 11:28, Mikolaj Machowski wrote:
                  > > Sorry, 'ts'.
                  > >
                  > > :lang english_united kingdom
                  > >
                  > > E197
                  > > Space I think.
                  >
                  > Er, wouldn't that just mean you don't have the UK English locale
                  > installed? Works a charm for me.
                  :r !ls /usr/local/share/vim/vim62/lang | grep kingdom
                  menu_english_united_kingdom.1252.vim
                  menu_english_united_kingdom.ascii.vim

                  m.
                  --
                  LaTeX + Vim = http://vim-latex.sourceforge.net/
                  Vim-list(s) Users Map: (last change 13 Nov)
                  http://skawina.eu.org/mikolaj/vimlist
                  Are You There?
                • Mike Williams
                  ... Er, looks Unixy to me. The patch was for Win32 only. Looks like other OSes will need a separate patch for good ol UK English. TTFN Mike -- When life
                  Message 8 of 11 , Nov 13, 2003
                  View Source
                  • 0 Attachment
                    On 13 Nov 2003 at 16:32, Mikolaj Machowski wrote:

                    > Dnia Thursday 13 of November 2003 12:12, Mike Williams napisa :
                    > > On 13 Nov 2003 at 11:28, Mikolaj Machowski wrote:
                    > > > Sorry, 'ts'.
                    > > >
                    > > > :lang english_united kingdom
                    > > >
                    > > > E197
                    > > > Space I think.
                    > >
                    > > Er, wouldn't that just mean you don't have the UK English locale
                    > > installed? Works a charm for me.
                    > :r !ls /usr/local/share/vim/vim62/lang | grep kingdom
                    > menu_english_united_kingdom.1252.vim
                    > menu_english_united_kingdom.ascii.vim

                    Er, looks Unixy to me. The patch was for Win32 only. Looks like
                    other OSes will need a separate patch for good ol' UK English.

                    TTFN

                    Mike
                    --
                    When life gets weird, the weird get a life.
                  • Bram Moolenaar
                    ... For Unix something like :lang english doesn t work at all. At least for me. I have to type exactly a name that can be found in /usr/share/locale. Even
                    Message 9 of 11 , Nov 13, 2003
                    View Source
                    • 0 Attachment
                      Mike Williams wrote:

                      > On 13 Nov 2003 at 16:32, Mikolaj Machowski wrote:
                      >
                      > > Dnia Thursday 13 of November 2003 12:12, Mike Williams napisa :
                      > > > On 13 Nov 2003 at 11:28, Mikolaj Machowski wrote:
                      > > > > Sorry, 'ts'.
                      > > > >
                      > > > > :lang english_united kingdom
                      > > > >
                      > > > > E197
                      > > > > Space I think.
                      > > >
                      > > > Er, wouldn't that just mean you don't have the UK English locale
                      > > > installed? Works a charm for me.
                      > > :r !ls /usr/local/share/vim/vim62/lang | grep kingdom
                      > > menu_english_united_kingdom.1252.vim
                      > > menu_english_united_kingdom.ascii.vim
                      >
                      > Er, looks Unixy to me. The patch was for Win32 only. Looks like
                      > other OSes will need a separate patch for good ol' UK English.

                      For Unix something like ":lang english" doesn't work at all. At least
                      for me. I have to type exactly a name that can be found in
                      /usr/share/locale. Even changing upper/lower case will break it.

                      If you do type the correct name, then the messages will be found.
                      That's because the first two letters of the locale are equal to the
                      language name, which is used for the message files. On Win32 these full
                      language names are used for the locale, those require the lookup table
                      for the messages to work.

                      --
                      Q: What is the difference betwee open-source and commercial software?
                      A: If you have a problem with commercial software you can call a phone
                      number and they will tell you it might be solved in a future version.
                      For open-source sofware there isn't a phone number to call, but you
                      get the solution within a day.

                      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                      /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
                      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                      \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
                    • Mike Williams
                      Hi, ... I tried this on my linux box last night and actually found UK message handling was broken. The language code should be en_GB, not en_gb so the
                      Message 10 of 11 , Nov 14, 2003
                      View Source
                      • 0 Attachment
                        Hi,

                        On 13 Nov 2003 at 17:57, Bram Moolenaar wrote:

                        > For Unix something like ":lang english" doesn't work at all. At least
                        > for me. I have to type exactly a name that can be found in
                        > /usr/share/locale. Even changing upper/lower case will break it.
                        >
                        > If you do type the correct name, then the messages will be found.
                        > That's because the first two letters of the locale are equal to the
                        > language name, which is used for the message files. On Win32 these full
                        > language names are used for the locale, those require the lookup table
                        > for the messages to work.

                        I tried this on my linux box last night and actually found UK message
                        handling was broken. The language code should be en_GB, not en_gb so
                        the messages directory was not being found. Not a problem on
                        Windows, it being case insensitive. Attached is a patch to correct
                        this and be consistent (and a small doc change).

                        TTFN

                        Mike
                        --
                        I've reached my wit's end - but kept going straight on.
                      • Bram Moolenaar
                        ... I ll include the patch and rename en_gb to en_GB. Thanks! -- If they don t keep on exercising their lips, he thought, their brains start working. --
                        Message 11 of 11 , Nov 14, 2003
                        View Source
                        • 0 Attachment
                          Mike Williams wrote:

                          > On 13 Nov 2003 at 17:57, Bram Moolenaar wrote:
                          >
                          > > For Unix something like ":lang english" doesn't work at all. At least
                          > > for me. I have to type exactly a name that can be found in
                          > > /usr/share/locale. Even changing upper/lower case will break it.
                          > >
                          > > If you do type the correct name, then the messages will be found.
                          > > That's because the first two letters of the locale are equal to the
                          > > language name, which is used for the message files. On Win32 these full
                          > > language names are used for the locale, those require the lookup table
                          > > for the messages to work.
                          >
                          > I tried this on my linux box last night and actually found UK message
                          > handling was broken. The language code should be en_GB, not en_gb so
                          > the messages directory was not being found. Not a problem on
                          > Windows, it being case insensitive. Attached is a patch to correct
                          > this and be consistent (and a small doc change).

                          I'll include the patch and rename en_gb to en_GB. Thanks!

                          --
                          If they don't keep on exercising their lips, he thought, their brains
                          start working.
                          -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

                          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                          /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
                          \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                          \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
                        Your message has been successfully submitted and would be delivered to recipients shortly.