Skip to content
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

Add support for localized message transalations in MacVim #1070

Merged
merged 1 commit into from
Aug 10, 2020

Conversation

ychin
Copy link
Member

@ychin ychin commented Aug 10, 2020

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.

Note: This does not add translations for menus. It only adds translations for Vim messages (e.g. "Press Enter" prompts, dialog box messages, or the intro screen).

Close #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
@ychin ychin force-pushed the macvim-locale-message-translation branch from 6a0ac01 to c27ef2a Compare August 10, 2020 09:23
@ychin ychin merged commit a756713 into macvim-dev:master Aug 10, 2020
@ychin ychin deleted the macvim-locale-message-translation branch August 10, 2020 10:30
ychin added a commit to ychin/macvim that referenced this pull request Aug 11, 2020
Since macvim-dev#1070 added support for localized messages for MacVim, add some
translations for some MacVim-specific messages (only add intro text
and :version output for now) for some languages (es, ja, zh) to make the
intro screen look less like an odd mix.
@ychin ychin added this to the snapshot-164 milestone Oct 3, 2020
ychin added a commit to ychin/macvim that referenced this pull request Nov 27, 2022
When adding support for gettext in macvim-dev#1070, a MacVim-specific ifdef was
added unnecessary around `bindtextdomain`. That ifdef isn't actually
necessary and it seems to have been done due to an incorrect
understanding of the ifdef logic there regarding `FEAT_GETTEXT`. Just
remove it to clean it up. Localization should still work.
ychin added a commit to ychin/macvim that referenced this pull request Jan 2, 2023
When adding support for gettext in macvim-dev#1070, a MacVim-specific ifdef was
added unnecessary around `bindtextdomain`. That ifdef isn't actually
necessary and it seems to have been done due to an incorrect
understanding of the ifdef logic there regarding `FEAT_GETTEXT`. Just
remove it to clean it up. Localization should still work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multilang messages not used
1 participant