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 761958 - Webcam directory name not translatable
Webcam directory name not translatable
Status: RESOLVED FIXED
Product: cheese
Classification: Applications
Component: general
git master
Other Linux
: Normal enhancement
: ---
Assigned To: Cheese Maintainer(s)
Cheese Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-02-12 15:19 UTC by Anders Jonsson
Modified: 2016-03-24 14:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fileutil: implement translation of folder to save captured pics and videos (1.67 KB, patch)
2016-03-22 17:27 UTC, Ilya Kuzmin
needs-work Details | Review
fileutil: implement translation of Webcam folder (2.05 KB, patch)
2016-03-22 18:26 UTC, Ilya Kuzmin
committed Details | Review

Description Anders Jonsson 2016-02-12 15:19:18 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.
Comment 1 Ilya Kuzmin 2016-03-22 17:27:37 UTC
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 2 Ilya Kuzmin 2016-03-22 17:32:25 UTC
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
Comment 3 David King 2016-03-22 17:46:33 UTC
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
Comment 4 Ilya Kuzmin 2016-03-22 18:26:12 UTC
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.
Comment 5 David King 2016-03-22 18:32:53 UTC
Review of attachment 324553 [details] [review]:

Looks good to me!
Comment 6 David King 2016-03-24 14:22:47 UTC
Review of attachment 324553 [details] [review]:

Pushed to master as commit b1a348cada555202cfe08e7b8eab61e9d2497b36. Thanks!