GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
GDCore
Tools
Localization.h
Go to the documentation of this file.
1
/*
2
* GDevelop Core
3
* Copyright 2008-2016 Florian Rival (
[email protected]
). All rights
4
* reserved. This project is released under the MIT License.
5
*/
6
#ifndef GDCORE_LOCALIZATION_H
7
#define GDCORE_LOCALIZATION_H
8
19
#if defined(EMSCRIPTEN)
20
// When compiling with Emscripten, use a translation function that is calling a
21
// JS method on the module, so that an external translation library can be used.
22
23
#include "GDCore/String.h"
24
#if defined(_)
25
#undef _
26
#endif
27
28
namespace
gd
{
29
gd::String
GetTranslation(
const
gd::String
& str);
30
31
gd::String
GetTranslation(
const
char
* str);
32
}
// namespace gd
33
34
#define _(s) gd::GetTranslation(u8##s)
35
36
#else
37
// When compiling without Emscripten,
38
// just return an untranslated gd::String.
39
40
// Create a new macro to return UTF8 gd::String from a translation
41
#if defined(_)
42
#undef _
43
#endif
44
#define _(s) gd::String(u8##s)
45
46
#endif
47
48
#endif
// GDCORE_LOCALIZATION_H
gd::String
String represents an UTF8 encoded string.
Definition:
String.h:33
gd
Definition:
CommonTools.h:24
Generated by
1.9.1