ThierryHFR / scangearmp2

This project is a sane backend for the canon's scanner, based on the source code of scangearmp2.
Other
78 stars 17 forks source link

Default paper size #34

Closed j1schmid closed 3 years ago

j1schmid commented 3 years ago

Default paper size (at app start) according to the locale variable LC_PAPER instead of LANG. On systems with system installation language en_US (locale variable LANG) may have another environment configuration for the paper format (locale variable LC_PAPER).

ThierryHFR commented 3 years ago

In my case, the variable LC_PAPER is empty. If the variable LC_PAPER is empty use the variable LANG.

$ echo $LC_PAPER

$ echo $LANG
fr_FR.UTF-8

You could do this:

    if( ( env_locale = (char *)getenv( "LC_PAPER" ) ) == NULL ){
        if( ( env_locale = (char *)getenv( "LANG" ) ) == NULL ){
            env_locale = "";
        }
    }
j1schmid commented 3 years ago

Definitely the better solution to use the locale variable LANG as fallback. Thanks again. I hope now the "pull-request" is ready to merge.

ThierryHFR commented 3 years ago

Thank you for your contribution.