~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to general/g.parser/translate.c

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdlib.h>
 
2
#include <string.h>
 
3
 
 
4
#include "proto.h"
 
5
 
 
6
#include <grass/glocale.h>
 
7
 
 
8
/* Returns translated version of a string.
 
9
   If global variable to output strings for translation is set it spits them out */
 
10
char *translate(const char *arg)
 
11
{
 
12
    static const char *domain;
 
13
 
 
14
    if (arg == NULL)
 
15
        return arg;
 
16
 
 
17
    if (strlen(arg) == 0)
 
18
        return NULL; /* unset */
 
19
    
 
20
    if (*arg && translate_output) {
 
21
        fputs(arg, stdout);
 
22
        fputs("\n", stdout);
 
23
    }
 
24
 
 
25
#if defined(HAVE_LIBINTL_H) && defined(USE_NLS)
 
26
    if (!domain) {
 
27
        domain = getenv("GRASS_TRANSLATION_DOMAIN");
 
28
        if (domain)
 
29
            G_putenv("GRASS_TRANSLATION_DOMAIN", "grassmods");
 
30
        else
 
31
            domain = PACKAGE;
 
32
    }
 
33
 
 
34
    return G_gettext(domain, arg);
 
35
#else
 
36
    return arg;
 
37
#endif
 
38
}