Opened 8 years ago

Last modified 7 years ago

#50776 new enhancement

PortGroup/"base" extension suggestion : locale_select — at Initial Version

Reported by: RJVB (René Bertin) Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts Future
Component: base Version:
Keywords: Cc:
Port:

Description

As suggested elsewhere (https://trac.macports.org/ticket/49051#comment:17) I propose a new PortGroup which might inspire an extension of "base".

The aim is to allow users who don't like or cannot afford to waste disk space (on things they don't use) to reduce the number of translations installed by ports. A good example is port:VLC : this one consists for over 50% of translations, most of which will never be used by the (vast) majority of users. That may be "only" around 37Mb, which is why I've hesitated a bit to make this proposal. Still, leaving only the en_GB, fr and nl translations that overhead shrinks to about 1.2Mb .

The principle of this PortGroup is simple: if adds a variant (tentatively called langselect) which adds a post-destroot block that prunes translations from ${destroot}${prefix}/share/locale, leaving only translations the user is interested in. This happens only when the variant is active, of course, but also requires the user to list the translation(s) s/he is interested in. Those desired translations are read from a list assignment to a variable calledkeep_languages in ${prefix}/etc/macports/locales.tcl. A locales.conf file would be nicer but I didn't want to spend too much time figuring out how to write a parser for that kind of file.

Currently the code only removes translations from the share/locale directory, but one could extend the principle to prune unwanted .lproj directories too.

Change History (1)

Changed 8 years ago by RJVB (René Bertin)

Attachment: locale_select-1.0.tcl added
Note: See TracTickets for help on using tickets.