I'm sure that evince could have a localized default, but it would seem to be the
wrong place to do it.

It's looking like whatever solution we take we are going to have to modify some
code, but if we would be considering creating a GConf key, then I would suggest
a more central one that could be used by all apps.  (e.g
/apps/gnome-print/paper/paper_size - which currently exists, but is always
defaulted to A4).

This could then in turn be localized for each locale... And if evince was
changed to use it then the correct default would be more likely to be picked up.

Darren.

On 01/06/2009 09:29, Takao Fujiwara - Tokyo S/W Center wrote:
> Brian:
> 
> Brian Cameron-san wrote (05/31/09 01:19 AM):
>>
>> Takao:
>>
>>> It seems LC_PAPER is GNU extensions but not POSIX.
>>> http://www.gnu.org/software/hello/manual/autoconf/Special-Shell-Variables.html
>>>   
>>>
>>> It may be better to use getenv("LC_PAPER") besides setlocale(LC_PAPER, 
>>> NULL) until the RFE is fixed.
>>
>> Are you saying that we should modify evince to check the LC_PAPER 
>> environment variable, because it doesn't do so now?  And this would
>> allow people to set the default letter if they want?
> 
> Yes, my understanding is, the fix of bugzilla 525185 could provide US letter 
> when users set LC_PAPER=en_US.UTF-8 but the default would be A4.
> Solaris(and BSD) doesn't have GNU libc and I guess the original problem is 
> not resolved in Solaris?
> 
>>
>> Do you have any ideas where & how LC_PAPER should be set for users?
> 
> I think just ideas.
> 
> 1. Evince has the internal data of US letter and A4 size. e.g.
> 
>    if (setlocale (LC_PAPER, NULL) == NULL &&
>        g_getenv ("LC_PAPER") != NULL) {
>      const char *lc_paper_str = g_getenv ("LC_PAPER");
> 
>      if (g_ascii_strncasecmp (lc_paper_str, "en_US", 5) == 0) {
>        /* US Letter size */
>        width = 21.59;
>        height = 27.94;
>      }
>      else if (g_str_has_suffix (lc_paper_str, "@letter")) {
>        /* US Letter size */
>        width = 21.59;
>        height = 27.94;
>      }
>      else {
>        /* A4 size */
>        width = 20.99;
>        height = 29.70;
>      }
>    }
> 
> 
> 2. Evince has an alternate choice with gconf. e.g.
> 
>    if (setlocale (LC_PAPER, NULL) == NULL) {
>      GConfClient *client = gconf_client_get_default ();
> 
>      paper = gconf_client_get_string (client, "/apps/evince/default_paper", 
> NULL);
>      width = gconf_client_get_float (client, "/apps/evince/default_width", 
> NULL);
>      height = gconf_client_get_float (client, "/apps/evince/default_height", 
> NULL);
> 
>      if (paper != NULL &&
>          g_ascii_strcasecmp (paper, "letter") == 0) {
>        /* US Letter size */
>        width = 21.59;
>        height = 27.94;
>      }
>      else if (paper != NULL &&
>          g_ascii_strcasecmp (paper, "a4") == 0) {
>        /* A4 size */
>        width = 20.99;
>        height = 29.70;
>      }
> 
>      width = (width > 0.0) ? width : 20.99;
>      height = (height > 0.0) ? height : 29.70;
>    }
> 
> fujiwara
> 
>>
>> Brian
>>
>>
>>> Darren Kenny-san wrote (05/27/09 07:52 PM):
>>>> Hi Brian,
>>>>
>>>> On 26/05/2009 16:14, Brian Cameron wrote:
>>>>> Darren:
>>>>>
>>>>> If you needed to modify the patch to get it to backport, then I'd
>>>>> recommend updating it as a new attachment in the bug report and
>>>>> encourage the maintainers to put this patch into the next 2.26
>>>>> release.  I think it is a serious enough usability issue that 2.26
>>>>> users would appreciate this fix, especially if you already did all
>>>>> the work to prepare the patch.
>>>>
>>>> I'm not sure what you mean - I backported the fix from the GIT 
>>>> changes - and the
>>>> modifications were mainly just to get it to apply since other lines 
>>>> in the files
>>>> had all changed and as such it wouldn't apply using the patch command.
>>>>
>>>> I can't see any benefit of having the community make a change in 2.26 
>>>> when it's
>>>> already fixed and working there. If you mean putting it into the next 
>>>> 2.22
>>>> release then that's slightly different, and maybe worth mentioning, 
>>>> but I can't
>>>> imagine that there is likely to be a new 2.22 release of evince any 
>>>> time soon,
>>>> but I've updated the bug anyway :)
>>>>
>>>>> We should also file an enhancement request upstream so that the evince
>>>>> community can consider making the default letter size based on the
>>>>> user's locale setting, as Jim suggests later in the thread.  That
>>>>> seems a reasonable enhancement request that someone in the community
>>>>> might have an interest in working on.
>>>>
>>>> That already works upstream - Linux has the LC_PAPER locale variable 
>>>> - it's
>>>> Solaris that's lacking in this department, so needs to be fixed on 
>>>> Solaris...
>>>>
>>>> I've logged an RFE to track this request:
>>>>
>>>>     6845408 -  Solaris needs a mechanism to determine default print page
>>>>                    size based on locale.
>>>>
>>>> Thanks,
>>>>
>>>> Darren.
>>>> _______________________________________________
>>>> desktop-discuss mailing list
>>>> desktop-discuss at opensolaris.org
>>>>
>>>
>>
>>
> 

Reply via email to