Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.arch.embedded > #27286
| From | Mel Wilson <mwilson@the-wire.com> |
|---|---|
| Newsgroups | comp.arch.embedded |
| Subject | Re: Multi-language support on embedded plarforms |
| Date | 2017-09-08 17:33 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <oouk9a$vm$2@dont-email.me> (permalink) |
| References | <ooljr9$2kp$1@dont-email.me> <F0ysB.69878$EZ2.64724@fx22.iad> |
On Fri, 08 Sep 2017 10:43:48 -0400, Richard Damon wrote:
> On 9/5/17 3:30 AM, pozz wrote:
>> The _() function will search the translated string based on the current
>> language. If he can't find, it could return the first translation
>> (english).
>>
>> This approach has some disadvantages. It's difficult to exclude one
>> language from the build. If the languages are more than a couple, the
>> strings will be very long. The order of the translations (first
>> english, than italian, ...) is important and you have to remember it
>> for every string.
>>
>>
>> What approach do you use?
>
> If you really want to look by string, then your _ function just needs to
> search the translation table for that value, and then return the string
> desired translation instead of passing in the index. The lookup will
> take a bit of time, but not that long given your number of strings, and
> if you sort the strings by the base translation, you could binary search
> to find it.
This may have been said already (who can tell, here), but the gettext
convention
_("Some string that has to be translated")
can make it easy for some preprocessors of your own to pick out these
strings, manage a database of translations, and substitute the
translations into individual builds for each language. The '_' can just
be a syntactic marker -- doesn't need to be a callable function at all.
Back to comp.arch.embedded | Previous | Next — Previous in thread | Find similar | Unroll thread
Multi-language support on embedded plarforms pozz <pozzugno@gmail.com> - 2017-09-05 09:30 +0200
Re: Multi-language support on embedded plarforms David Brown <david.brown@hesbynett.no> - 2017-09-05 10:43 +0200
Re: Multi-language support on embedded plarforms Robert Wessel <robertwessel2@yahoo.com> - 2017-09-05 09:56 -0500
Re: Multi-language support on embedded plarforms Ian Collins <ian-news@hotmail.com> - 2017-09-06 07:50 +1200
Re: Multi-language support on embedded plarforms Robert Wessel <robertwessel2@yahoo.com> - 2017-09-05 17:11 -0500
Re: Multi-language support on embedded plarforms Keith Thompson <kst-u@mib.org> - 2017-09-05 15:17 -0700
Re: Multi-language support on embedded plarforms Robert Wessel <robertwessel2@yahoo.com> - 2017-09-05 19:19 -0500
Re: Multi-language support on embedded plarforms raltbos@xs4all.nl (Richard Bos) - 2017-09-09 12:37 +0000
Re: Multi-language support on embedded plarforms Robert Wessel <robertwessel2@yahoo.com> - 2017-09-09 16:16 -0500
Re: Multi-language support on embedded plarforms raltbos@xs4all.nl (Richard Bos) - 2017-09-15 17:17 +0000
Re: Multi-language support on embedded plarforms Allan Herriman <allanherriman@hotmail.com> - 2017-09-06 11:27 +0000
Re: Multi-language support on embedded plarforms Paul <paul@pcserviceselectronics.co.uk> - 2017-09-05 10:04 +0100
Re: Multi-language support on embedded plarforms Theo Markettos <theom+news@chiark.greenend.org.uk> - 2017-09-06 10:55 +0100
Re: Multi-language support on embedded plarforms Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-09-05 17:00 -0400
Re: Multi-language support on embedded plarforms Keith Thompson <kst-u@mib.org> - 2017-09-07 10:55 -0700
Re: Multi-language support on embedded plarforms scott@slp53.sl.home (Scott Lurndal) - 2017-09-07 18:41 +0000
Re: Multi-language support on embedded plarforms pozz <pozzugno@gmail.com> - 2017-09-08 11:33 +0200
Re: Multi-language support on embedded plarforms bartc <bc@freeuk.com> - 2017-09-08 11:32 +0100
Re: Multi-language support on embedded plarforms David Brown <david.brown@hesbynett.no> - 2017-09-08 13:37 +0200
Re: Multi-language support on embedded plarforms bartc <bc@freeuk.com> - 2017-09-08 14:48 +0100
Re: Multi-language support on embedded plarforms David Brown <david.brown@hesbynett.no> - 2017-09-08 16:45 +0200
Re: Multi-language support on embedded plarforms Richard Damon <Richard@Damon-Family.org> - 2017-09-08 10:43 -0400
Re: Multi-language support on embedded plarforms Mel Wilson <mwilson@the-wire.com> - 2017-09-08 17:33 +0000
csiph-web