GNOME Bugzilla – Bug 452707
InitiateMozillaDownload is not i18n friendly
Last modified: 2007-07-11 13:25:13 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.
Created attachment 91000 [details] [review] mozdownload.cpp patch It this patch OK?
+ char *slash_pos = strrchr (path->str, '/'); [etc.] I'd rather try to use g_path_get_basename() here.
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.
+ 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!
Created attachment 91148 [details] [review] MozDownload.cpp.patch I didn't know about that function :( Should have practiced more
+ char *new_path = g_build_filename (dirname, new_basename); g_build_filename (......, NULL); With that fixed, oktc.
Created attachment 91221 [details] [review] MozDownload.cpp patch
Nguyen, do you have an SVN account with which you can commit your patch?
(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.
Committed to trunk