Freeciv-3.2: /fast/freeciv/nightly/S3_2/common/scriptcore/api_common_intl.c Source File

Freeciv-3.2

Loading...
Searching...
No Matches
api_common_intl.c
Go to the documentation of this file.
1/*****************************************************************************
2 Freeciv - Copyright (C) 2005 - The Freeciv Project
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12*****************************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* utility */
19#include "fcintl.h"
20
21/* common/scriptcore */
22#include "luascript.h"
23
24#include "api_common_intl.h"
25
26/**********************************************************************/
29 const char *api_intl__(lua_State *L, const char *untranslated)
30{
31 LUASCRIPT_CHECK_STATE(L, NULL);
32 LUASCRIPT_CHECK_ARG_NIL(L, untranslated, 2, string, "");
33
34 return _(untranslated);
35}
36
37/**********************************************************************/
40 const char *api_intl_N_(lua_State *L, const char *untranslated)
41{
42 LUASCRIPT_CHECK_STATE(L, NULL);
43 LUASCRIPT_CHECK_ARG_NIL(L, untranslated, 2, string, "");
44
45 return N_(untranslated);
46}
47
48/**********************************************************************/
51 const char *api_intl_Q_(lua_State *L, const char *untranslated)
52{
53 LUASCRIPT_CHECK_STATE(L, NULL);
54 LUASCRIPT_CHECK_ARG_NIL(L, untranslated, 2, string, "");
55
56 return Q_(untranslated);
57}
58
59/**********************************************************************/
62 const char *api_intl_PL_(lua_State *L, const char *singular,
63 const char *plural, int n)
64{
65 LUASCRIPT_CHECK_STATE(L, NULL);
66 LUASCRIPT_CHECK_ARG_NIL(L, singular, 2, string, "");
67 LUASCRIPT_CHECK_ARG_NIL(L, plural, 3, string, "");
68
69 return PL_(singular, plural, n);
70}
api_intl_N_
const char * api_intl_N_(lua_State *L, const char *untranslated)
Definition api_common_intl.c:40
api_intl_PL_
const char * api_intl_PL_(lua_State *L, const char *singular, const char *plural, int n)
Definition api_common_intl.c:62
api_intl__
const char * api_intl__(lua_State *L, const char *untranslated)
Definition api_common_intl.c:29
api_intl_Q_
const char * api_intl_Q_(lua_State *L, const char *untranslated)
Definition api_common_intl.c:51
api_common_intl.h
n
#define n
Definition astring.c:77
incite_cost
char * incite_cost
Definition comments.c:74
fcintl.h
Q_
#define Q_(String)
Definition fcintl.h:70
PL_
#define PL_(String1, String2, n)
Definition fcintl.h:71
_
#define _(String)
Definition fcintl.h:67
N_
#define N_(String)
Definition fcintl.h:69
luascript.h
LUASCRIPT_CHECK_STATE
#define LUASCRIPT_CHECK_STATE(L,...)
Definition luascript.h:117
LUASCRIPT_CHECK_ARG_NIL
#define LUASCRIPT_CHECK_ARG_NIL(L, value, narg, type,...)
Definition luascript.h:138