// support.c
// LiVES
// portions of this file were auto-generated by glade, the remainder is (c) G. Finch (salsaman)

// released under the GNU GPL 3 or later
// see file ../COPYING or www.gnu.org for licensing details

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

#include "support.h"

#ifndef LIVES_INLINE
#ifndef IS_SOLARIS
#define LIVES_INLINE inline
#else
#define LIVES_INLINE
#endif
#endif


#ifdef ENABLE_NLS
LIVES_INLINE char *translate(const char *String) {
  if (trString!=NULL) lives_free(trString); // be very careful, as trString is free()d automatically here
  if (strlen(String)) trString=lives_locale_to_utf8(dgettext(PACKAGE, String),-1,NULL,NULL,NULL);
  else trString=lives_strdup(String);
  return trString;
}

LIVES_INLINE char *translate_with_plural(const char *String, const char *StringPlural, unsigned long int n) {
  if (trString!=NULL) lives_free(trString); // be very careful, as trString is free()d automatically here
  if (strlen(String)) trString=lives_locale_to_utf8(dngettext(PACKAGE, String, StringPlural, n),-1,NULL,NULL,NULL);
  else trString=lives_strdup(String);
  return trString;
}


#endif

