After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 452707 - InitiateMozillaDownload is not i18n friendly
InitiateMozillaDownload is not i18n friendly
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: [obsolete] Backend:Mozilla
git master
Other Linux
: Normal normal
: gnome-2-20
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-07-01 02:17 UTC by Nguyen Thai Ngoc Duy
Modified: 2007-07-11 13:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mozdownload.cpp patch (1.25 KB, patch)
2007-07-02 01:30 UTC, Nguyen Thai Ngoc Duy
none Details | Review
mozdownload.cpp.patch (1.40 KB, patch)
2007-07-02 23:55 UTC, Nguyen Thai Ngoc Duy
reviewed Details | Review
MozDownload.cpp.patch (1.38 KB, patch)
2007-07-04 00:17 UTC, Nguyen Thai Ngoc Duy
reviewed Details | Review
MozDownload.cpp patch (1.38 KB, patch)
2007-07-04 23:52 UTC, Nguyen Thai Ngoc Duy
accepted-commit_now Details | Review

Description Nguyen Thai Ngoc Duy 2007-07-01 02:17:52 UTC
Excerpt code from InitiateMozillaDownload in MozDownload.cpp:

		char *dot_pos = strchr (path->str, '.');
		if (dot_pos)
		{
			g_string_truncate (path, dot_pos - path->str);
		}
		g_string_append (path, " ");
		g_string_append (path, _("Files"));

It would be better with something like this

path = g_strdup_printf(_("%s's Files"), dot_pos);

i18n people then can give better translations. Anyway you should leave notes for translators, noting that this is a directory name.
Comment 1 Nguyen Thai Ngoc Duy 2007-07-02 01:30:14 UTC
Created attachment 91000 [details] [review]
mozdownload.cpp patch

It this patch OK?
Comment 2 Christian Persch 2007-07-02 11:20:18 UTC
+		char *slash_pos = strrchr (path->str, '/');
[etc.]

I'd rather try to use g_path_get_basename() here.
Comment 3 Nguyen Thai Ngoc Duy 2007-07-02 23:55:31 UTC
Created attachment 91067 [details] [review]
mozdownload.cpp.patch

New attempt using g_path_get_dirname/basename. This also fixes a bug that create wrong directory if download directory has a dot in it.
Comment 4 Christian Persch 2007-07-03 11:54:03 UTC
+		char *new_path = g_strdup_printf("%s%s%s",dirname, G_DIR_SEPARATOR_S, new_basename);

Use g_build_filename.

With that fixed, ok to commit. Thanks for the patch!
Comment 5 Nguyen Thai Ngoc Duy 2007-07-04 00:17:28 UTC
Created attachment 91148 [details] [review]
MozDownload.cpp.patch

I didn't know about that function :( Should have practiced more
Comment 6 Christian Persch 2007-07-04 11:05:54 UTC
+		char *new_path = g_build_filename (dirname, new_basename);

g_build_filename (......, NULL);

With that fixed, oktc.
Comment 7 Nguyen Thai Ngoc Duy 2007-07-04 23:52:18 UTC
Created attachment 91221 [details] [review]
MozDownload.cpp patch
Comment 8 Reinout van Schouwen 2007-07-08 11:42:35 UTC
Nguyen, do you have an SVN account with which you can commit your patch?
Comment 9 Nguyen Thai Ngoc Duy 2007-07-09 12:32:43 UTC
(In reply to comment #8)
> Nguyen, do you have an SVN account with which you can commit your patch?
> 

Yes, I have. I'll commit my patch soon.
Comment 10 Nguyen Thai Ngoc Duy 2007-07-11 13:25:13 UTC
Committed to trunk