Also translating gallery(1)

This commit is contained in:
Pierre Pronchery 2013-11-24 03:28:30 +01:00
parent a0cd2af83a
commit 0a0cc8fe20
5 changed files with 67 additions and 28 deletions

View File

@ -1,3 +1,4 @@
../src/camera.c
../src/main.c
../src/window.c
../tools/gallery.c

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Camera 0.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-05-23 21:35+0200\n"
"POT-Creation-Date: 2013-11-24 03:27+0100\n"
"PO-Revision-Date: 2013-01-18 22:31+0100\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: French\n"
@ -16,73 +16,83 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: ../src/camera.c:339
#: ../src/camera.c:336
msgid "Properties"
msgstr "Propriétés"
#: ../src/camera.c:352
#: ../src/camera.c:349
msgid "Driver: "
msgstr "Pilote : "
#: ../src/camera.c:356
#: ../src/camera.c:353
msgid "Card: "
msgstr "Carte : "
#: ../src/camera.c:360
#: ../src/camera.c:357
msgid "Bus info: "
msgstr "Bus : "
#: ../src/camera.c:364
#: ../src/camera.c:361
msgid "Version: "
msgstr "Version : "
#: ../src/camera.c:377
#: ../src/camera.c:374
msgid "Capabilities: "
msgstr "Capacités : "
#: ../src/camera.c:443 ../src/camera.c:446 ../src/camera.c:466
#: ../src/camera.c:485 ../src/camera.c:509 ../src/camera.c:514
#: ../src/camera.c:453 ../src/camera.c:456 ../src/camera.c:476
#: ../src/camera.c:495 ../src/camera.c:520 ../src/camera.c:538
msgid "Could not save picture"
msgstr "Impossible d'enregistrer l'image"
#: ../src/camera.c:562 ../src/camera.c:566
#: ../src/camera.c:540
msgid "Unknown error"
msgstr "Erreur inconnue"
#: ../src/camera.c:587 ../src/camera.c:591
msgid "Error"
msgstr "Erreur"
#: ../src/camera.c:697
#: ../src/camera.c:728
msgid "Could not open the video capture device"
msgstr "Impossible d'ouvrir le périphérique de capture vidéo"
#: ../src/camera.c:734
#: ../src/camera.c:765
msgid "Could not obtain the capabilities"
msgstr "Impossible d'obtenir les capacités"
#: ../src/camera.c:740
#: ../src/camera.c:771
msgid "Unsupported capabilities"
msgstr "Capacités non supportées"
#: ../src/camera.c:753
#: ../src/camera.c:784
msgid "Cropping not supported"
msgstr "Recadrage non supporté"
#: ../src/camera.c:758
#: ../src/camera.c:789
msgid "Could not obtain the video capture format"
msgstr "Impossible d'obtenir le format de capture vidéo"
#: ../src/camera.c:762
#: ../src/camera.c:793
msgid "Unsupported video capture type"
msgstr "Type de capture vidéo non supporté"
#: ../src/main.c:67
#: ../src/main.c:70
#, c-format
msgid ""
"Usage: camera [-d device][-O filename]\n"
"Usage: %s [-d device][-O filename]\n"
" -d\tVideo device to open\n"
" -O\tUse this file as an overlay\n"
msgstr ""
"Usage: camera [-d périphérique]\n"
"Usage: %s [-d périphérique]\n"
" -d\tPériphérique video à ouvrir\n"
" -O\tFichier en surimpression\n"
#: ../src/window.c:279
msgid "Simple camera application for the DeforaOS desktop"
msgstr "Caméra photo pour l'environnement DeforaOS"
#: ../tools/gallery.c:97
#, c-format
msgid "Usage: %s\n"
msgstr "Usage: %s\n"

View File

@ -24,7 +24,7 @@ gallery_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
gallery: $(gallery_OBJS)
$(CC) -o gallery $(gallery_OBJS) $(gallery_LDFLAGS)
gallery.o: gallery.c
gallery.o: gallery.c ../config.h
$(CC) $(gallery_CFLAGS) -c gallery.c
clean:

View File

@ -20,14 +20,27 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <locale.h>
#include <libintl.h>
#include <errno.h>
#include <glib.h>
#include <gtk/gtk.h>
#include "../config.h"
#define _(string) gettext(string)
/* constants */
#ifndef PROGNAME
# define PROGNAME "gallery"
#endif
#ifndef PREFIX
# define PREFIX "/usr/local"
#endif
#ifndef DATADIR
# define DATADIR PREFIX "/share"
#endif
#ifndef LOCALEDIR
# define LOCALEDIR DATADIR "/locale"
#endif
/* Gallery */
@ -35,12 +48,14 @@
/* prototypes */
static int _gallery(void);
static int _error(char const * message, int ret);
static int _usage(void);
/* functions */
/* gallery */
static int _gallery(void)
{
char const gallery[] = PROGNAME;
char const * homedir;
char const dcim[] = "DCIM";
char * path;
@ -55,25 +70,31 @@ static int _gallery(void)
if((homedir = getenv("HOME")) == NULL)
homedir = g_get_home_dir();
if((path = g_build_filename(homedir, dcim, NULL)) == NULL)
{
/* XXX errno may not be set */
fprintf(stderr, "%s: %s\n", gallery, strerror(errno));
return -1;
}
return -_error(NULL, 1);
/* this error should be caught by the final program */
mkdir(path, 0777);
argv[arg] = path;
execvp(argv[0], argv);
fprintf(stderr, "%s: %s: %s\n", gallery, argv[0], strerror(errno));
_error(argv[0], 1);
g_free(path);
return -1;
}
/* error */
static int _error(char const * message, int ret)
{
fprintf(stderr, "%s: %s%s%s\n", PROGNAME,
(message != NULL) ? message : "",
(message != NULL) ? ": " : "", strerror(errno));
return ret;
}
/* usage */
static int _usage(void)
{
fprintf(stderr, "Usage: %s\n", PROGNAME);
fprintf(stderr, _("Usage: %s\n"), PROGNAME);
return 1;
}
@ -85,6 +106,10 @@ int main(int argc, char * argv[])
{
int o;
if(setlocale(LC_ALL, "") == NULL)
_error("setlocale", 1);
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
while((o = getopt(argc, argv, "")) != -1)
switch(o)
{

View File

@ -8,3 +8,6 @@ dist=Makefile
type=binary
sources=gallery.c
install=$(BINDIR)
[gallery.c]
depends=../config.h