Skip to content

Conversation

@mhinz
Copy link
Contributor

@mhinz mhinz commented Apr 28, 2022

In a locale "en_US", "en" is the language and "US" is the region.

Before this change, we were too clever for our own good and tried to handle the
region as well. But if the macOS primary language is set to "English" and the
region to "Norway", we would end up with "en_NO", which is a locale that does
not exist.

Now we only take the language into account. Taking the example from above would
yield "en_US", which is a sensible fallback.

If the region is important to you, set $LANG and the more specific LC_*
variables in your shell config or alternatively use :help :language.

References #18292

@github-actions github-actions bot added the build building and installing Neovim using the provided scripts label Apr 28, 2022
@github-actions github-actions bot requested a review from jamessan April 28, 2022 19:12
@mhinz mhinz force-pushed the mac/simpler-locale-fallback branch from dc26491 to 40f0c2d Compare April 28, 2022 19:24
@mhinz mhinz changed the title fix(mac): use same $LANG fallback mechanism as Vim [WIP] fix(mac): use same $LANG fallback mechanism as Vim Apr 28, 2022
In a locale "en_US", "en" is the language and "US" is the region.

Before this change, we were too clever for our own good and tried to handle the
region as well. But if the macOS primary language is set to "English" and the
region to "Norway", we would end up with "en_NO", which is a locale that does
not exist.

Now we only take the language into account. Taking the example from above would
yield "en_US", which is a sensible fallback.

If the region is important to you, set $LANG and the more specific LC_*
variables in your shell config or alternatively use `:help :language`.

References neovim#18292
@mhinz mhinz force-pushed the mac/simpler-locale-fallback branch from 40f0c2d to e038625 Compare April 28, 2022 21:38
ELOG("$LANG is empty and the macOS primary language cannot be inferred.");
}
CFRelease(cf_lang_region);
# ifdef HAVE_LOCALE_H
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deliberately left out the checks for HAVE_LOCALE_H and LC_NUMERIC, because I think it's not needed within __APPLE__.

@mhinz mhinz changed the title [WIP] fix(mac): use same $LANG fallback mechanism as Vim fix(mac): use same $LANG fallback mechanism as Vim Apr 28, 2022
@clason clason added platform:macos localization l10n environment user system environment (terminal, shell, tmux) backport release-0.7 and removed build building and installing Neovim using the provided scripts labels Apr 29, 2022
@clason
Copy link
Member

clason commented Apr 29, 2022

Looks fine to me, and fixes the linked issue!

@jamessan what do you think?

@mhinz
Copy link
Contributor Author

mhinz commented Apr 29, 2022

James mentioned that he's on vacation right now, so we should give him a few days to respond. :)

@clason
Copy link
Member

clason commented Apr 29, 2022

Yup, just wanted to let him know that I'll merge it only(!) when he's looked at it and given his thumbs-up.

@jamessan jamessan merged commit 371dfb1 into neovim:master May 1, 2022
@github-actions github-actions bot removed the request for review from jamessan May 1, 2022 23:15
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2022

Successfully created backport PR #18351 for release-0.7.

@mhinz mhinz deleted the mac/simpler-locale-fallback branch May 3, 2022 12:51
clason added a commit that referenced this pull request Jun 19, 2022
Problem:
The release script bundles a system library (CoreServices) that was
added in #18294, which leads to errors on M1 since the architecture is
different from the Github runner.

Solution:
Skip CoreServices when bundling the libraries (as was done for the
CoreFoundation library that #18294 replaced with CoreServices).
clason added a commit that referenced this pull request Jun 19, 2022
Problem:
The release script bundles a system library (CoreServices) that was
added in #18294, which leads to errors on M1 since the architecture is
different from the Github runner.

Solution:
Skip CoreServices when bundling the libraries (as was done for the
CoreFoundation library that #18294 replaced with CoreServices).
kraftwerk28 pushed a commit to kraftwerk28/neovim that referenced this pull request Jul 6, 2022
Problem:
The release script bundles a system library (CoreServices) that was
added in neovim#18294, which leads to errors on M1 since the architecture is
different from the Github runner.

Solution:
Skip CoreServices when bundling the libraries (as was done for the
CoreFoundation library that neovim#18294 replaced with CoreServices).
smjonas pushed a commit to smjonas/neovim that referenced this pull request Dec 31, 2022
Problem:
The release script bundles a system library (CoreServices) that was
added in neovim#18294, which leads to errors on M1 since the architecture is
different from the Github runner.

Solution:
Skip CoreServices when bundling the libraries (as was done for the
CoreFoundation library that neovim#18294 replaced with CoreServices).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

environment user system environment (terminal, shell, tmux) localization l10n platform:macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants