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

Don't build/install non-UTF-8 and encoding-converted locales #1397

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

ychin
Copy link
Member

@ychin ychin commented Mar 20, 2023

Currently a lot of the .po locale files are generated using iconv to different encodings. This is only necessary if the version of Vim does not have iconv and cannot dynamically convert encoding, which isn't the case for MacVim. Furthermore, MacVim should only work in UTF-8 anyway, so it's not useful to have all the other non-UTF-8 locales (e.g. zh_CN.cp936.po) being built and bundled together, as they make the build process more complicated and bulk up the binary size of the app bundle.

Simply modify the Makefile to not install / build any of the duplicate locale files. For locales like ko/zh_CN/zh_TW, where the "base" version ko.po is in a non-UTF-8 locale and converted from a ko.UTF-8.po, we keep only the ko.UTF-8.po version, but during install we install the folder as "ko" instead of "ko.UTF-8". This way, if someone somehow set LANG=ko_KR, it will still work instead of having to set LANG=ko_KR.UTF-8.

Currently, pl.po is an odd one out because pl.UTF-8.po is actually generated from pl.po, instead of the other way round. We just use pl.po since that's the source version, instead of using the generated UTF-8 one for simplicity (MacVim can handle it fine).

Also, revert the MacVim-local translations made to these non-UTF8 locales like zh_CN.cp936.po, since we don't use them anymore in MacVim builds.

Saved ~2 MB in the app bundle, and ~1MB in the generated dmg.

@ychin ychin added this to the Release 177 milestone Mar 20, 2023
Currently a lot of the .po locale files are generated using iconv to
different encodings. This is only necessary if the version of Vim does
not have iconv and cannot dynamically convert encoding, which isn't the
case for MacVim. Furthermore, MacVim should only work in UTF-8 anyway,
so it's not useful to have all the other non-UTF-8 locales (e.g.
zh_CN.cp936.po) being built and bundled together, as they make the build
process more complicated and bulk up the binary size of the app bundle.

Simply modify the Makefile to not install / build any of the duplicate
locale files. For locales like ko/zh_CN/zh_TW, where the "base" version
ko.po is in a non-UTF-8 locale and converted from a ko.UTF-8.po, we keep
only the ko.UTF-8.po version, but during install we install the folder
as "ko" instead of "ko.UTF-8". This way, if someone somehow set
LANG=ko_KR, it will still work instead of having to set
LANG=ko_KR.UTF-8.

Currently, pl.po is an odd one out because pl.UTF-8.po is actually
generated from pl.po, instead of the other way round. We just use pl.po
since that's the source version, instead of using the generated UTF-8
one for simplicity (MacVim can handle it fine).

Also, revert the MacVim-local translations made to these non-UTF8
locales like zh_CN.cp936.po, since we don't use them anymore in MacVim
builds.

Saved ~2 MB in the app bundle, and ~1MB in the generated dmg.
@ychin ychin force-pushed the remove-locales-dup-encoding branch from f5575ed to a9d5810 Compare March 20, 2023 01:52
@ychin ychin merged commit 572c492 into macvim-dev:master Mar 20, 2023
@ychin ychin deleted the remove-locales-dup-encoding branch March 20, 2023 03:28
tono pushed a commit to tono/macvim that referenced this pull request Mar 21, 2023
…ding

Don't build/install non-UTF-8 and encoding-converted locales
ychin added a commit that referenced this pull request Jul 10, 2023
Updated to Vim 9.0.1677

Announcements
====================

Website
--------------------

The official website for MacVim is now https://macvim.org. Previously it just
forwarded to https://macvim-dev.github.io/macvim/. You can also read the MacVim
documentation at https://macvim.org/docs/gui_mac.txt.html. #1385

Features
====================

Updater / What's New page
--------------------

There is now a "What's New" page that will automatically be shown whenever
MacVim detected that it has been updated to a new version (can be disabled in
Settings). The page will also include all the release notes if you have
updated across multiple versions. This feature is useful for users who turned
on "Automatically install updates" or installs MacVim through other methods
like Homebrew but would still like to see the release notes when a new version
comes out. You can also access it through the Help menu. #1414

MacVim should now report its version in a much more consistent manner in the
"About MacVim" page and when the updater reports there is a new version. It
should look something like "r176 (Vim 9.0.1276)" where "r176" is the MacVim
release number and the 9.0.1276 is the bundled Vim version. #1293 #1393

Sparkle (updater for MacVim) is now updated to 2.4.2. #1416

New Vim features
--------------------

- New bundled colorschemes: wildcharm/retrobox/sorbet/zaibatsu (vim/vim#12163)
- File encryption now has a new `cryptmethod`: `xchacha20v2`, which is designed
  to be more forward compatible with future Vim versions than `xchacha20`.
  (v9.0.1481)
- `switchbuf` works for more commands. (v9.0.1546)
- Statusline now supports multiple alignment "%=" items. (v9.0.1300)
- New UTF-16 utility functions (`strutf16len` and `utf16idx`) (v9.0.1485)
- Misc 'smoothscroll' bugs fixes

General
====================

* Removed non-Unicode localization files, which helps cut down on app size. #1397
* Miscellaneous documentation fixes. #1415 #1375 #1386 #1363 (by @dkav)
* The disk image for MacVim (MacVim.dmg) is now in APFS and uses better
  compression for better efficiency. #1409

Fixes
====================

* Printing a file in macOS 13 Ventura (using `:hardcopy` or File→Print) should
  work again. #1390
* Fixed a broken symlink to XPCServices in the Sparkle framework. #1367
* Fixed MacVim to not throw (safe) Objective C exceptions when quitting. #1371
* Fixed welcome message not being aligned properly in Simplified Chinese and
  show the Vim 9 prompt. #1381
* Removed some unnecessary test files in the runtime folders which were
  included erroneously. #1418

Scripting
====================

- Scripting languages versions:
    - Python is now built against 3.11, up from 3.10.

Compatibility
====================

Requires macOS 10.9 or above. (10.9 - 10.12 requires downloading a
separate legacy build)

Script interfaces have compatibility with these versions:

- Lua 5.4
- Perl 5.30
- Python2 2.7
- Python3 3.11
- Ruby 3.2
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.

1 participant