Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.arch.embedded,comp.lang.c Subject: Re: Multi-language support on embedded plarforms Date: Thu, 07 Sep 2017 10:55:24 -0700 Organization: None to speak of Lines: 38 Message-ID: <871snil7g3.fsf@kst-u.example.com> References: NNTP-Posting-Host: yof3Bim8nHvSFYG0YE16HA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:YQSyQKjfbJkB360CyxxDyHslV3U= Xref: csiph.com comp.arch.embedded:27268 comp.lang.c:119104 pozz writes: > [This message is posted to comp.arch.embedded and comp.lang.c] > > Just for reference, an embedded platform based on a MCU with > integrated Flash, for example a Cortex-Mx device. > Here I consider only western languages (left-to-right and european > chars, english, french, german, spanish and so on). > > The main problem is the translation of strings, maybe 10-100 strings. > > I know something about gettext package that can't be used in those > embeded platforms. However I like the approach of gettext. > > print_to_display(x, y, "Hello world!"); > > is simply changed in: > > #include > ... > print_to_display(x, y, _("Hello world!")); [snip] GNU gettext is free software, licensed under GPLv3. I wonder if you could grab a copy of it, remove any functionality you don't need, and end up with something small enough to work on your embedded system. In a very quick look at the gettext sources, I see that the gettext-runtime/src subdirectory contains about 1300 lines of C code. If that's all that needs to run on the target system, you might even be able to use it without modification. (Any licensing issues are left as an exercise.) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"