Freeciv21
Develop your civilization from humble roots to a global empire
api_common_intl.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  part of Freeciv21. Freeciv21 is free software: you can redistribute it
4  and/or modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation, either version 3 of the
6  License, or (at your option) any later version. You should have received
7  a copy of the GNU General Public License along with Freeciv21. If not,
8  see https://www.gnu.org/licenses/.
9  */
10 
11 // utility
12 #include "fcintl.h"
13 
14 /* common/scriptcore */
15 #include "luascript.h"
16 
17 #include "api_common_intl.h"
18 
22 const char *api_intl__(sol::this_state s, const char *untranslated)
23 {
24  LUASCRIPT_CHECK_ARG_NIL(s, untranslated, 2, string, "");
25 
26  return _(untranslated);
27 }
28 
32 const char *api_intl_N_(sol::this_state s, const char *untranslated)
33 {
34  LUASCRIPT_CHECK_ARG_NIL(s, untranslated, 2, string, "");
35 
36  return N_(untranslated);
37 }
38 
42 const char *api_intl_Q_(sol::this_state s, const char *untranslated)
43 {
44  LUASCRIPT_CHECK_ARG_NIL(s, untranslated, 2, string, "");
45 
46  return Q_(untranslated);
47 }
48 
52 const char *api_intl_PL_(sol::this_state s, const char *singular,
53  const char *plural, int n)
54 {
55  LUASCRIPT_CHECK_ARG_NIL(s, singular, 2, string, "");
56  LUASCRIPT_CHECK_ARG_NIL(s, plural, 3, string, "");
57 
58  return PL_(singular, plural, n);
59 }
const char * api_intl_PL_(sol::this_state s, const char *singular, const char *plural, int n)
Translation helper function.
const char * api_intl_N_(sol::this_state s, const char *untranslated)
Translation helper function.
const char * api_intl_Q_(sol::this_state s, const char *untranslated)
Translation helper function.
const char * api_intl__(sol::this_state s, const char *untranslated)
Translation helper function.
#define Q_(String)
Definition: fcintl.h:53
#define PL_(String1, String2, n)
Definition: fcintl.h:54
#define _(String)
Definition: fcintl.h:50
#define N_(String)
Definition: fcintl.h:52
#define LUASCRIPT_CHECK_ARG_NIL(L, value, narg, type,...)
Definition: luascript.h:131