User: Password:
|
|
Subscribe / Log in / New account

A report from OSCON 2007

A report from OSCON 2007

Posted Aug 3, 2007 3:05 UTC (Fri) by joey (subscriber, #328)
In reply to: A report from OSCON 2007 by jwb
Parent article: A report from OSCON 2007

I think the question is, why is your cat looking for locales at all, if it's just catting a file. Mine only looks for locales if I run it with --help or something.


(Log in to post comments)

A report from OSCON 2007

Posted Aug 3, 2007 4:48 UTC (Fri) by carenas (guest, #46541) [Link]

LANG=C

would get rid of all those extra "locale" file lookups

A report from OSCON 2007

Posted Aug 3, 2007 7:36 UTC (Fri) by tzafrir (subscriber, #11501) [Link]

Actually the help message is surely somethng that needs translation. Hence there is a point in looking at LC_MESSAGES for the translation just for running cat --help .

Error messages cat spits out in case it can't find your file can also be translated.

A report from OSCON 2007

Posted Aug 3, 2007 17:56 UTC (Fri) by ajross (guest, #4563) [Link]

strace -eopen cat /dev/null

It reads the (non-existent) locale files even when no output is generated.

A report from OSCON 2007

Posted Aug 4, 2007 12:10 UTC (Sat) by tzafrir (subscriber, #11501) [Link]

right, so you want to complicate the code of every program:

if(open failed) {
get_translations();
error message
}

print_help_message(){
get_translations();
help message
}

A report from OSCON 2007

Posted Aug 4, 2007 20:36 UTC (Sat) by madscientist (subscriber, #16861) [Link]

That's not required. Every time a program needs to translate a message, it calls a function to do the translation. It should not be too difficult to modify the code for "lazy evaluation", where the locale catalog is not set up until the first time a message needs to be translated, and hide this inside the i18n libraries.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds