GNOME Bugzilla – Bug 761958
Webcam directory name not translatable
Last modified: 2016-03-24 14:26:08 UTC
Cheese as default saves pictures and videos in the directories XDG_PICTURES_DIR/Webcam and XDG_VIDEOS_DIR/Webcam. Here XDG_PICTURES_DIR and XDG_VIDEOS_DIR are translatable through xdg-user-dirs. It would be nice if the subdirectory "Webcam" was offered for translation as well.
Created attachment 324547 [details] [review] fileutil: implement translation of folder to save captured pics and videos In this commit I added the feature that folder containing captured photos and videos has a name that suits the locale is used by system. The problem is that folder to save captured pics and videos has strict name "Webcam". To fix this problem I used gettext method.
Comment on attachment 324547 [details] [review] fileutil: implement translation of folder to save captured pics and videos >From fa95315f4249afab75370a2159c25c52ee8870cd Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9A=D1=83=D0=B7=D1=8C=D0=BC?= > =?UTF-8?q?=D0=B8=D0=BD?= <dargonaxxe@gmail.com> >Date: Tue, 22 Mar 2016 23:05:59 +0600 >Subject: [PATCH] fileutil: implement translation of folder to save captured > pics and videos > >In this commit I added the feature that folder containing captured photos and videos has a name that suits the locale is used by system. > >The problem is that folder to save captured pics and videos has strict name "Webcam". > >To fix this problem I used gettext method. > >https://bugzilla.gnome.org/show_bug.cgi?id=761958 >--- > libcheese/cheese-fileutil.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/libcheese/cheese-fileutil.c b/libcheese/cheese-fileutil.c >index 6eb4c3f..89743e6 100644 >--- a/libcheese/cheese-fileutil.c >+++ b/libcheese/cheese-fileutil.c >@@ -26,6 +26,7 @@ > #include <glib.h> > #include <gio/gio.h> > #include <string.h> >+#include <libintl.h> > > #include "cheese-fileutil.h" > >@@ -279,7 +280,7 @@ cheese_fileutil_init (CheeseFileUtil *fileutil) > /* Get XDG. */ > if (video_path) > { >- priv->video_path = g_build_filename (video_path, "Webcam", NULL); >+ priv->video_path = g_build_filename (video_path, gettext ("Webcam"), NULL); > } > else > { >@@ -299,7 +300,7 @@ cheese_fileutil_init (CheeseFileUtil *fileutil) > /* Get XDG. */ > if (photo_path) > { >- priv->photo_path = g_build_filename (photo_path, "Webcam", NULL); >+ priv->photo_path = g_build_filename (photo_path, gettext ("Webcam"), NULL); > } > else > { >-- >2.5.0
Review of attachment 324547 [details] [review]: You will also need to add libcheese/cheese-fileutil.c to po/POTFILES.in. Also, please keep the first line of the commit message to 50 characters, and use 72 characters for the following lines. ::: libcheese/cheese-fileutil.c @@ +27,3 @@ #include <gio/gio.h> #include <string.h> +#include <libintl.h> Use <glib/gi18n-lib.h> instead (as it comes as part of GLib). @@ +281,3 @@ if (video_path) { + priv->video_path = g_build_filename (video_path, gettext ("Web"), NULL); Rather than calling gettext() directly, use the macro "_()": https://developer.gnome.org/glib/stable/glib-I18N.html#gettext-macro
Created attachment 324553 [details] [review] fileutil: implement translation of Webcam folder In this commit I added the feature that folder containing captured photos and videos has a name that suits the locale is used by system. The problem is that folder to save captured pics and videos has strict name "Webcam". To fix this problem I used gettext method.
Review of attachment 324553 [details] [review]: Looks good to me!
Review of attachment 324553 [details] [review]: Pushed to master as commit b1a348cada555202cfe08e7b8eab61e9d2497b36. Thanks!