From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10004 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: gettext and locale names Date: Wed, 4 May 2016 17:39:38 -0400 Message-ID: <20160504213938.GV21636@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1462397994 11988 80.91.229.3 (4 May 2016 21:39:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 May 2016 21:39:54 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10017-gllmg-musl=m.gmane.org@lists.openwall.com Wed May 04 23:39:53 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ay4WP-0001TL-HY for gllmg-musl@m.gmane.org; Wed, 04 May 2016 23:39:53 +0200 Original-Received: (qmail 30297 invoked by uid 550); 4 May 2016 21:39:51 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 30273 invoked from network); 4 May 2016 21:39:50 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10004 Archived-At: On Wed, May 04, 2016 at 10:05:28PM +0900, Masanori Ogino wrote: > Hello, > > When I played with gettext API, I found that musl searches .mo files > with a directory named as current *full* locale names, e.g. > en_US.UTF-8. However, we often use shortened names too. Here is a list > of those names from those of my machine in /usr/share/locale: de, > en_GB, ru_UA.koi8u, sr@latin, etc. > > Due to this mismatch, we can't get translations with musl's gettext > API for applications in wild. Thus, I'm considering to implement > locale searching with shortening. Does it make sense? Yes, I think this makes sense. Before spending time on the code though it makes sense to discuss the proposed logic here. What level would the search/shortening happen at? __get_locale in locale_map.c? In dcngettext.c? Rich