RSS/Atom feed Twitter
Site is read-only, email is disabled

wget plugin

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

wget plugin Alexandre Prokoudine 01 Apr 08:56
  wget plugin Mukund Sivaraman 01 Apr 09:31
   wget plugin Mikael Magnusson 01 Apr 11:45
Alexandre Prokoudine
2012-04-01 08:56:54 UTC (almost 13 years ago)

wget plugin

Hi,

I've been wondering for a while why the plug-in for fetching an image from network location always shows its messages in English, so I ended up looking into the code...

plug-ins/file-uri/uri-backend-wget.c has this:

g_setenv ("LANGUAGE", "C", TRUE); g_setenv ("LC_ALL", "C", TRUE); g_setenv ("LANG", "C", TRUE);

And then translatable messages follow.

So the plug-in doesn't even give those messages a chance to show up as translated, while providing false hope :)

Is there a reason for such a cruelty? :)

Alexandre Prokoudine http://libregraphicsworld.org

Mukund Sivaraman
2012-04-01 09:31:30 UTC (almost 13 years ago)

wget plugin

Hi Alexandre

On Sun, Apr 01, 2012 at 12:56:54PM +0400, Alexandre Prokoudine wrote:

Hi,

I've been wondering for a while why the plug-in for fetching an image from network location always shows its messages in English, so I ended up looking into the code...

plug-ins/file-uri/uri-backend-wget.c has this:

g_setenv ("LANGUAGE", "C", TRUE); g_setenv ("LC_ALL", "C", TRUE); g_setenv ("LANG", "C", TRUE);

And then translatable messages follow.

So the plug-in doesn't even give those messages a chance to show up as translated, while providing false hope :)

Is there a reason for such a cruelty? :)

The plug-in parses the output of wget to gather the status of what happened. So it needs the output of wget in the C locale, so it has just 1 variant to compare.

The wget plug-in is a fallback option. Maybe you can use GVFS or libcurl.

Mukund

Mikael Magnusson
2012-04-01 11:45:45 UTC (almost 13 years ago)

wget plugin

On 1 April 2012 11:31, Mukund Sivaraman wrote:

Hi Alexandre

On Sun, Apr 01, 2012 at 12:56:54PM +0400, Alexandre Prokoudine wrote:

Hi,

I've been wondering for a while why the plug-in for fetching an image from network location always shows its messages in English, so I ended up looking into the code...

plug-ins/file-uri/uri-backend-wget.c has this:

g_setenv ("LANGUAGE", "C", TRUE); g_setenv ("LC_ALL", "C", TRUE); g_setenv ("LANG", "C", TRUE);

And then translatable messages follow.

So the plug-in doesn't even give those messages a chance to show up as translated, while providing false hope :)

Is there a reason for such a cruelty? :)

The plug-in parses the output of wget to gather the status of what happened. So it needs the output of wget in the C locale, so it has just 1 variant to compare.

It does the setenv after forking, so it shouldn't affect messages getting translated in the parent process:

else if (pid == 0) {
gchar timeout_str[16];

close (p[0]); close (2);
dup (p[1]);
close (p[1]);

/* produce deterministic output */ g_setenv ("LANGUAGE", "C", TRUE); g_setenv ("LC_ALL", "C", TRUE); g_setenv ("LANG", "C", TRUE);

g_snprintf (timeout_str, sizeof (timeout_str), "%d", TIMEOUT);

execlp ("wget", "wget", "-v", "-e", "server-response=off", "--progress=dot", "-T", timeout_str, uri, "-O", tmpname, NULL); _exit (127);
}