"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "translate.c" between
motion-release-4.2.2.tar.gz and motion-Release-4.3.0.tar.gz

About: Motion monitors the video signal from one or more cameras and is able to detect motion.

translate.c  (motion-release-4.2.2):translate.c  (motion-Release-4.3.0)
skipping to change at line 14 skipping to change at line 14
* This software is distributed under the GNU Public License Version 2 * This software is distributed under the GNU Public License Version 2
* See also the file 'COPYING'. * See also the file 'COPYING'.
* *
*/ */
#include <locale.h> #include <locale.h>
#include "motion.h" #include "motion.h"
#include "translate.h" #include "translate.h"
void translate_locale_chg(const char *langcd){ void translate_locale_chg(const char *langcd){
#ifdef HAVE_INTL #ifdef HAVE_GETTEXT
/* This routine is for development testing only. It is not used for /* This routine is for development testing only. It is not used for
* regular users because once this locale is change, it changes the * regular users because once this locale is change, it changes the
* whole computer over to the new locale. Therefore, we just return * whole computer over to the new locale. Therefore, we just return
*/ */
return; return;
setenv ("LANGUAGE", langcd, 1); setenv ("LANGUAGE", langcd, 1);
/* Invoke external function to change locale*/ /* Invoke external function to change locale*/
++_nl_msg_cat_cntr; ++_nl_msg_cat_cntr;
#else #else
if (langcd != NULL) MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO,"No native language s upport"); if (langcd != NULL) MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO,"No native language s upport");
#endif #endif
} }
void translate_init(void){ void translate_init(void){
#ifdef HAVE_INTL #ifdef HAVE_GETTEXT
/* Set the flag to enable native language support */ /* Set the flag to enable native language support */
nls_enabled = 1; nls_enabled = 1;
setlocale (LC_ALL, ""); setlocale (LC_ALL, "");
//translate_locale_chg("li"); //translate_locale_chg("li");
translate_locale_chg("es"); translate_locale_chg("es");
bindtextdomain ("motion", LOCALEDIR); bindtextdomain ("motion", LOCALEDIR);
bind_textdomain_codeset ("motion", "UTF-8"); bind_textdomain_codeset ("motion", "UTF-8");
skipping to change at line 55 skipping to change at line 55
#else #else
/* Disable native language support */ /* Disable native language support */
nls_enabled = 0; nls_enabled = 0;
/* This avoids a unused function warning */ /* This avoids a unused function warning */
translate_locale_chg("en"); translate_locale_chg("en");
#endif #endif
} }
char* translate_text(const char *msgid){ char* translate_text(const char *msgid){
#ifdef HAVE_INTL #ifdef HAVE_GETTEXT
if (nls_enabled){ if (nls_enabled){
return (char*)gettext(msgid); return (char*)gettext(msgid);
} else { } else {
return (char*)msgid; return (char*)msgid;
} }
#else #else
return (char*)msgid; return (char*)msgid;
#endif #endif
} }
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)