-
-
Notifications
You must be signed in to change notification settings - Fork 686
Multilang messages not used #991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@benknoble |
@eirnym Perhaps I wasn't clear—I'm not referring to help topics or to the menus. I'm talking about messages. The little things that popup and say, do you want to quit? Hit enter to continue... Swap file detected, press a button: Or this copy-paste of my (normal vim) translated intro
vs. macvim (even in terminal):
As far as I can tell, terminal vim ships with the messages translations. I don't care about the menus and the help topics (the french ones are so out of date as to be practically useless, and I don't have the time to work on them). These messages are, however, muscle memory (the prompts use keys that depend on the first letter of the action to take, which obviously differ w.r.t. language). |
I believe all you need is this from vim/vim: https://github.com/vim/vim/tree/26967617a30e55aedc98b8f14b841d88469abd0e/src/po |
I agree with you. Because of the reasons I've mentioned, all other translations are disabled in this repo. |
#776 is basically the same issue on that topic |
This is not the same as "no menu translations," which I see in
I would have expected translating internal messages to be completely achievable (since it is a simple string mapping at runtime), irrespective of the gui menu issues (which has to do with Apple's system). I understand (I think) why we have |
Menu translations should be done on a different level than translation for the rest of the ViM Core. Vim Core has it's translations in editable files, while translations of a MacOS app is done in other ways. So yes, this confirms, that the menu translations are missing. Currently, most of menu done in So I invite you to contribute translations for many languages for parts which are missing in Vim Core or have to be done in the other way than has been in Vim Core. |
Let me find for you some of the places required for translations |
In the project there's Xcode string catalogs named After this, we need to translate Also you need to know about differences with input, and edit commands accordingly. I use keyboard After these two parts has been done, help documentation should be also translated. |
I'm going to repeat what I started with: I don't have any interest in menu or help translations for MacVim at this time. What I care about is the messages translation. They are all already translated in vim "core." I do not see why they cannot be used as is for MacVim's text-based message. |
I agree with you. The language selection in MacOS applications is done in a different way than in terminal and for other systems. To make it consistent other translations has been disabled. If you insist, I can give you the exact answer what is the problem with enabling localisation. |
Let me take a look. |
I hoped that this would also fix issue #11 that 5 years later is still an ongoing problem and is eerily similar, but alas, no. Could the acquired knowledge fixing this also help to fix the other issue? |
@yanncoupin Yeah, I think these are a bit different. Here, I'm talking very specifically about translation of messages/error codes/etc., which was already done in vim core--there has been some confusion on this issue, so let me re-emphasize it is not about the menus, which I understand won't be translated anytime soon. Your issue is interesting though--seems like vim relies on some functions that depend on locale under the hood, and maybe doesn't appropriately force the locale for its parsing? At any rate, when I launch vim (terminal, macvim from GUI, or macvim from terminal), I have locale set to French/UTF-8; that is, the environment variables are set in my terminal in addition to the language in Preferences. The issue I have here is it seems like it would be easy to use the same translation mechanism as vim core for the messaging text (not the menu text) for display to a user in an error or on |
After the latest locale changes, MacVim correctly sets locale. The locale change was disabled back in a day because of absence of macOS app menu, Vim menu and Vim help translations. Doing Vim menu translation is very simple as menu is quite similar to GVim and we can borrow it from there. My opinion is macOS app menu and changes in help could be in English for a while and translation help is requested. @ychin What do you think on this matter? |
My recent change (#1036) is somewhat related but not completely. @yanncoupin I couldn't quite repro the issue, but please use another issue to track as it's not related to this. Anyway, @benknoble, I tried the Vim bundled with macOS Catalina, and built vanilla Vim, and I couldn't get the language translation to work. Do you know if this is supposed to work on normal Vim (aka not-MacVim)? Your problem description made it sound like this usually works, but I couldn't quite get a non-English |
@ychin yes, with the locale set as described, terminal vim gives messages in french. More details on that when I get in front of a computer. |
@ychin see the screenshot:
|
Sorry but I still can't repro @benknoble . Can you show me exactly:
For what it's worth, I tried using macOS Catalina's system vim and also building vanilla Vim myself (
Anything else? |
Ok I figured it out. I think you are installing Vim from Homebrew and not using system Vim. And that works because it has Edit: Actually, that doesn't seem like it. Yeah do you mind providing more info where you managed to get a localized version of Vim on macOS? |
Found explanation why translations are not used in MacVim: #776 |
@ychin yeah fair enough; thanks for taking the time on this. You'd think I would know that by now, having dealt with lots of issues on a popular vim plugin 😅
Just
No, I think you're correct—I think it's that homebrew vim has gettext support compiled in. The other two ( |
This enables localized translated messages in MacVim, instead of only using English. - Get Travis to compile MacVim with gettext dependencies which is a pre-requisite for multilang localized messages. Also add a quick regression test to make sure localized messages will keep working. - Add a post-build phase to copy all locale .mo files to VIMRUNTIME/lang so they will be bundled along with the rest in the app package. Normal Vim usually installs the localized files to a global location like /usr/local/share/locale/ but macOS applications are all self-contained bundles we don't want to do this. Use VIMRUNTIME/lang as the destination because that's also what the Windows build uses and existing code already knows to use it by using bindtextdomain. - Fix vim.h header to not unbind bindtextdomain for MacVim. There is previously a little bit of hack there where it would only use bindtextdomain when DYNAMIC_GETTEXT is set because that's only set for Windows. Just add a special case for MacVim for now to get similar behavior to Windows. Close macvim-dev#991
This enables localized translated messages in MacVim, instead of only using English. - Get Travis to compile MacVim with gettext dependencies which is a pre-requisite for multilang localized messages. Also add a quick regression test to make sure localized messages will keep working. - Add a post-build phase to copy all locale .mo files to VIMRUNTIME/lang so they will be bundled along with the rest in the app package. Normal Vim usually installs the localized files to a global location like /usr/local/share/locale/ but macOS applications are all self-contained bundles we don't want to do this. Use VIMRUNTIME/lang as the destination because that's also what the Windows build uses and existing code already knows to use it by using bindtextdomain. - Fix vim.h header to not unbind bindtextdomain for MacVim. There is previously a little bit of hack there where it would only use bindtextdomain when DYNAMIC_GETTEXT is set because that's only set for Windows. Just add a special case for MacVim for now to get similar behavior to Windows. Close macvim-dev#991
This enables localized translated messages in MacVim, instead of only using English. - Get Travis to compile MacVim with gettext dependencies which is a pre-requisite for multilang localized messages. Also add a quick regression test to make sure localized messages will keep working. - Add a post-build phase to copy all locale .mo files to VIMRUNTIME/lang so they will be bundled along with the rest in the app package. Normal Vim usually installs the localized files to a global location like /usr/local/share/locale/ but macOS applications are all self-contained bundles we don't want to do this. Use VIMRUNTIME/lang as the destination because that's also what the Windows build uses and existing code already knows to use it by using bindtextdomain. - Fix vim.h header to not unbind bindtextdomain for MacVim. There is previously a little bit of hack there where it would only use bindtextdomain when DYNAMIC_GETTEXT is set because that's only set for Windows. Just add a special case for MacVim for now to get similar behavior to Windows. Close macvim-dev#991
This enables localized translated messages in MacVim, instead of only using English. - Get Travis to compile MacVim with gettext dependencies which is a pre-requisite for multilang localized messages. Also add a quick regression test to make sure localized messages will keep working. - Add a post-build phase to copy all locale .mo files to VIMRUNTIME/lang so they will be bundled along with the rest in the app package. Normal Vim usually installs the localized files to a global location like /usr/local/share/locale/ but macOS applications are all self-contained bundles we don't want to do this. Use VIMRUNTIME/lang as the destination because that's also what the Windows build uses and existing code already knows to use it by using bindtextdomain. - Fix vim.h header to not unbind bindtextdomain for MacVim. There is previously a little bit of hack there where it would only use bindtextdomain when DYNAMIC_GETTEXT is set because that's only set for Windows. Just add a special case for MacVim for now to get similar behavior to Windows. Close macvim-dev#991
This is now fixed. MacVim will now recognize locale and show localized messages. Not all messages are localized though, as MacVim-specific messages aren't localized. If you do
Note that the last sentence is not translated. (Feel free to submit PRs to fix it) And of course menus are not localized per discussion here. I may look into that in the future and see how bad of a mix we have with localized and non-localized menu names. If you are installing MacVim through Homebrew though it won't work yet. Their formula (macvim.rb) doesn't specify gettext as a dependency, which needs to be added for this to work. Will need to make a PR at https://github.com/homebrew/homebrew-core. |
Vim patch 8.2.1424 Features - New "Appearance" option pane (accessible via Cmd-, or MacVim -> Preferences) to allow customizing how MacVim looks. Users can now select how MacVim works with Dark Mode, and configure titlebar to be hidden or transparent. #912 #1038 #1056 - MacVim localization support. It now uses translated Vim messages for the specified locale. See `:help multilang-messages` to see how to configure it. #991 General: - Python is now built against 3.8, up from 3.7. #1012 Fixes: - Fix mvim:// protocol handler behavior. Reverts behavior back to old behavior (before snapshot-162), but add new fallback handling to try to handle poorly formed URLs that don't double-encode special characters. See `:help macvim://`. #1055 - Can now change tabs using menu and keyboard shortcuts (Cmd-{ / Cmd-} / Cmd-T) when in terminal mode. #1045 Targets macOS 10.9+ Script interfaces have compatibility with these versions: - Lua 5.3 - Perl 5.18 - Python2 2.7 - Python3 3.8 - Ruby 2.7
Vim patch 8.2.1456 Features - New "Appearance" option pane (accessible via Cmd-, or MacVim -> Preferences) to allow customizing how MacVim looks. Users can now select how MacVim works with Dark Mode, and configure titlebar to be hidden or transparent. macvim-dev#912 macvim-dev#1038 macvim-dev#1056 - MacVim localization support. It now uses translated Vim messages for the specified locale. See `:help multilang-messages` to see how to configure it. macvim-dev#991 General: - Python is now built against 3.8, up from 3.7. macvim-dev#1012 Fixes: - Fix mvim:// protocol handler behavior. Reverts behavior back to old behavior (before snapshot-162), but add new fallback handling to try to handle poorly formed URLs that don't double-encode special characters. See `:help macvim://`. macvim-dev#1055 - Can now change tabs using menu and keyboard shortcuts (Cmd-{ / Cmd-} / Cmd-T) when in terminal mode. macvim-dev#1045 - Fix crash during MacVim launch in Snapshot 164 (8.2.1424) due to dynamic library linkage. macvim-dev#1073 Targets macOS 10.9+ Script interfaces have compatibility with these versions: - Lua 5.3 - Perl 5.18 - Python2 2.7 - Python3 3.8 - Ruby 2.7
Vim patch 8.2.1456 Features - New "Appearance" option pane (accessible via Cmd-, or MacVim -> Preferences) to allow customizing how MacVim looks. Users can now select how MacVim works with Dark Mode, and configure titlebar to be hidden or transparent. #912 #1038 #1056 - MacVim localization support. It now uses translated Vim messages for the specified locale. See `:help multilang-messages` to see how to configure it. #991 General: - Python is now built against 3.8, up from 3.7. #1012 Fixes: - Fix mvim:// protocol handler behavior. Reverts behavior back to old behavior (before snapshot-162), but add new fallback handling to try to handle poorly formed URLs that don't double-encode special characters. See `:help macvim://`. #1055 - Can now change tabs using menu and keyboard shortcuts (Cmd-{ / Cmd-} / Cmd-T) when in terminal mode. #1045 - Fix crash during MacVim launch in Snapshot 164 (8.2.1424) due to dynamic library linkage. #1073 Targets macOS 10.9+ Script interfaces have compatibility with these versions: - Lua 5.3 - Perl 5.18 - Python2 2.7 - Python3 3.8 - Ruby 2.7
Describe the bug
In terminal vim with
+multi_lang
and locale as follows, the messages are all in French.In macvim, however, even when running in the terminal, messages are not localized. They remain in English.
Note that I'm not talking about menus, the translations for which I understand were recently borked. I'm talking about messages, and the interface such as the "quit anyway?" prompt.
To Reproduce
Detailed steps to reproduce the behavior:
vim --clean
(orgvim --clean
, etc.):lang
(with a non-English locale) ->Current language: "fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8"
:intro
screen is translatedExpected behavior
Terminal vim translates all messages and such.
Environment (please complete the following information):
Additional context
This really bugs me because it defeats the muscle memory I have built up to respond to prompts and read messages—I'm used to the French now. I don't want to go back to English messages. I rarely use the
:gui
part of MacVim, but it's nice for external applications (i.e. away from the terminal). I could always remove it from my shell'sPATH
but continue to use it as a graphical app, but that too is unsatisfactory.The text was updated successfully, but these errors were encountered: