Remove separate translate module

This commit is contained in:
MrDave
2019-09-27 21:08:36 -06:00
committed by Mr-Dave
parent b6038af62d
commit c55eba3b2e
36 changed files with 138 additions and 179 deletions

View File

@@ -12,7 +12,6 @@ src/netcam.c
src/picture.c
src/rotate.c
src/track.c
src/translate.c
src/video_common.c
src/video_loopback.c
src/video_v4l2.c

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 11:59-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1263,6 +1263,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr ""
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2577,10 +2581,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr ""
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 11:59-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1264,6 +1264,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr "Sprache: Deutsch"
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2578,10 +2582,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr "Sprache: Deutsch"
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 12:00-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1264,6 +1264,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr "Idioma: Español"
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2578,10 +2582,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr "Idioma: Español"
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 12:00-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1263,6 +1263,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr ""
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2577,10 +2581,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr ""
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 12:01-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1270,6 +1270,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr ""
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2584,10 +2588,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr ""
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 12:02-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1263,6 +1263,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr ""
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2577,10 +2581,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr ""
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 12:02-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1263,6 +1263,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr ""
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2577,10 +2581,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr ""
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 12:02-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1263,6 +1263,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr ""
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2577,10 +2581,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr ""
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 12:02-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1264,6 +1264,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr "Kalba: Lietuvių"
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2578,10 +2582,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr "Kalba: Lietuvių"
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 12:03-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1263,6 +1263,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr ""
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2577,10 +2581,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr ""
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 12:03-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1263,6 +1263,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr ""
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2577,10 +2581,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr ""
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 12:03-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1263,6 +1263,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr ""
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2577,10 +2581,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr ""
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 12:04-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1263,6 +1263,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr "Språk: Svenska"
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2577,10 +2581,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr "Språk: Svenska"
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 4.x\n"
"Report-Msgid-Bugs-To: https://motion-project.github.io\n"
"POT-Creation-Date: 2019-09-25 23:02-0600\n"
"POT-Creation-Date: 2019-09-27 21:06-0600\n"
"PO-Revision-Date: 2018-10-13 12:04-0600\n"
"Last-Translator: MrDave <MotionMrDave@gmail.com>\n"
"Language-Team: MrDave <MotionMrDave@gmail.com>\n"
@@ -1263,6 +1263,10 @@ msgstr ""
msgid "Unable to return a buffer to the camera video port"
msgstr ""
#: src/motion.c
msgid "Language: English"
msgstr ""
#: src/motion.c
#, c-format
msgid "Resizing pre_capture buffer to %d items"
@@ -2577,10 +2581,6 @@ msgstr ""
msgid "After_REL_Y_Angel : x= %d , Y= %d"
msgstr ""
#: src/translate.c
msgid "Language: English"
msgstr ""
#: src/video_common.c
msgid "Corrupt image ... continue"
msgstr ""

View File

@@ -11,6 +11,6 @@ bin_PROGRAMS = motion
motion_SOURCES = motion.c logger.c conf.c draw.c jpegutils.c video_loopback.c \
video_v4l2.c video_common.c \
netcam.c track.c alg.c event.c picture.c \
rotate.c translate.c movie.c \
rotate.c movie.c \
webu.c webu_html.c webu_stream.c webu_text.c mmalcam.c $(MMAL_SRC)

View File

@@ -27,7 +27,6 @@
#include <dirent.h>
#include <string.h>
#include <regex.h>
#include "translate.h"
#include "motion.h"
#define EXTENSION ".conf"

View File

@@ -8,7 +8,6 @@
see also the file 'COPYING'.
*/
#include "picture.h" /* already includes motion.h */
#include "translate.h"
#include "netcam.h"
#include "movie.h"
#include "event.h"

View File

@@ -48,7 +48,6 @@
* jpgutl_decode_jpeg
*/
#include "translate.h"
#include "config.h"
#include "motion.h"
#include "jpegutils.h"

View File

@@ -11,7 +11,6 @@
*
*/
#include "translate.h"
#include "motion.h"
#include "rotate.h"

View File

@@ -6,7 +6,6 @@
* See also the file 'COPYING'.
*
*/
#include "translate.h"
#include "motion.h"
#include "movie.h"
#include "video_common.h"
@@ -70,6 +69,59 @@ FILE *ptr_logfile = NULL;
unsigned int restart = 0;
void translate_locale_chg(const char *langcd){
#ifdef HAVE_GETTEXT
/* This routine is for development testing only. It is not used for
* regular users because once this locale is change, it changes the
* whole computer over to the new locale. Therefore, we just return
*/
return;
setenv ("LANGUAGE", langcd, 1);
/* Invoke external function to change locale*/
++_nl_msg_cat_cntr;
#else
if (langcd != NULL) MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO,"No native language support");
#endif
}
void translate_init(void){
#ifdef HAVE_GETTEXT
/* Set the flag to enable native language support */
nls_enabled = 1;
setlocale (LC_ALL, "");
//translate_locale_chg("li");
translate_locale_chg("es");
bindtextdomain ("motion", LOCALEDIR);
bind_textdomain_codeset ("motion", "UTF-8");
textdomain ("motion");
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO,_("Language: English"));
#else
/* Disable native language support */
nls_enabled = 0;
/* This avoids a unused function warning */
translate_locale_chg("en");
#endif
}
char* translate_text(const char *msgid){
#ifdef HAVE_GETTEXT
if (nls_enabled){
return (char*)gettext(msgid);
} else {
return (char*)msgid;
}
#else
return (char*)msgid;
#endif
}
/**
* image_ring_resize
*

View File

@@ -35,6 +35,7 @@ struct image_data;
#ifndef __USE_GNU
#define __USE_GNU
#endif
#include <locale.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
@@ -68,6 +69,14 @@ struct image_data;
#include "mmalcam.h"
#endif
int nls_enabled;
#ifdef HAVE_GETTEXT
# include <libintl.h>
extern int _nl_msg_cat_cntr; /* Required for changing the locale dynamically */
#endif
#define _(STRING) translate_text(STRING)
/**
* ATTRIBUTE_UNUSED:
@@ -541,4 +550,8 @@ void util_threadname_set(const char *abbr, int threadnbr, const char *threadname
void util_threadname_get(char *threadname);
int util_check_passthrough(struct context *cnt);
char* translate_text(const char *msgid);
void translate_init(void);
void translate_locale_chg(const char *langcd);
#endif /* _INCLUDE_MOTION_H */

View File

@@ -21,7 +21,6 @@
* indicate libav
*/
#include "translate.h"
#include "motion.h"
/****************************************************************************

View File

@@ -16,7 +16,6 @@
#include <stdio.h>
#include <regex.h>
#include "translate.h"
#include "rotate.h" /* already includes motion.h */
#include "netcam.h"
#include "video_v4l2.h" /* Needed to validate palette for v4l2 via netcam */

View File

@@ -9,7 +9,6 @@
*
*/
#include "translate.h"
#include "picture.h"
#include "jpegutils.h"
#include "event.h"

View File

@@ -29,7 +29,6 @@
* - speed optimization, including bswap
* v1 (28-Aug-2004) - initial version
*/
#include "translate.h"
#include "rotate.h"
#include <stdint.h>
#if defined(__APPLE__)

View File

@@ -6,7 +6,6 @@
* This program is published under the GNU Public license
*/
#include <math.h>
#include "translate.h"
#include "motion.h"
#ifdef HAVE_V4L2

View File

@@ -1,64 +0,0 @@
/*
* Translations for Web User control interface.
*
* This software is distributed under the GNU Public License Version 2
* See also the file 'COPYING'.
*
*/
#include <locale.h>
#include "motion.h"
#include "translate.h"
void translate_locale_chg(const char *langcd){
#ifdef HAVE_GETTEXT
/* This routine is for development testing only. It is not used for
* regular users because once this locale is change, it changes the
* whole computer over to the new locale. Therefore, we just return
*/
return;
setenv ("LANGUAGE", langcd, 1);
/* Invoke external function to change locale*/
++_nl_msg_cat_cntr;
#else
if (langcd != NULL) MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO,"No native language support");
#endif
}
void translate_init(void){
#ifdef HAVE_GETTEXT
/* Set the flag to enable native language support */
nls_enabled = 1;
setlocale (LC_ALL, "");
//translate_locale_chg("li");
translate_locale_chg("es");
bindtextdomain ("motion", LOCALEDIR);
bind_textdomain_codeset ("motion", "UTF-8");
textdomain ("motion");
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO,_("Language: English"));
#else
/* Disable native language support */
nls_enabled = 0;
/* This avoids a unused function warning */
translate_locale_chg("en");
#endif
}
char* translate_text(const char *msgid){
#ifdef HAVE_GETTEXT
if (nls_enabled){
return (char*)gettext(msgid);
} else {
return (char*)msgid;
}
#else
return (char*)msgid;
#endif
}

View File

@@ -1,26 +0,0 @@
/*
* translate.h
*
* Include file for translate.c
*
* This software is distributed under the GNU Public License Version 2
* See also the file 'COPYING'.
*
*/
#ifndef _INCLUDE_TRANSLATE_H_
#define _INCLUDE_TRANSLATE_H_
int nls_enabled;
#ifdef HAVE_GETTEXT
# include <libintl.h>
extern int _nl_msg_cat_cntr; /* Required for changing the locale dynamically */
#endif
#define _(STRING) translate_text(STRING)
char* translate_text(const char *msgid);
void translate_init(void);
void translate_locale_chg(const char *langcd);
#endif // _INCLUDE_TRANSLATE_H_

View File

@@ -8,7 +8,7 @@
* See also the file 'COPYING'.
*
*/
#include "translate.h"
#include "motion.h"
#include "video_common.h"
#include "video_v4l2.h"

View File

@@ -8,7 +8,6 @@
* See also the file 'COPYING'.
*
*/
#include "translate.h"
#include "motion.h"
#if (defined(HAVE_V4L2)) && (!defined(BSD))

View File

@@ -17,7 +17,6 @@
* for more details.
*
*/
#include "translate.h"
#include "rotate.h" /* Already includes motion.h */
#include "video_common.h"
#include "video_v4l2.h"

View File

@@ -42,7 +42,6 @@
#include "webu_html.h"
#include "webu_text.h"
#include "webu_stream.h"
#include "translate.h"
/* Context to pass the parms to functions to start mhd */
struct mhdstart_ctx {

View File

@@ -36,7 +36,6 @@
#include "motion.h"
#include "webu.h"
#include "webu_html.h"
#include "translate.h"
/* struct to save information regarding the links to include in html page */
struct strminfo_ctx {

View File

@@ -16,7 +16,6 @@
#include "motion.h"
#include "webu.h"
#include "webu_stream.h"
#include "translate.h"
static void webu_stream_mjpeg_checkbuffers(struct webui_ctx *webui) {
/* Allocate buffers if needed */

View File

@@ -22,7 +22,6 @@
#include "motion.h"
#include "webu.h"
#include "webu_text.h"
#include "translate.h"
static void webu_text_seteol(struct webui_ctx *webui) {
/* Set the end of line character for text interface */