GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
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 char* str);
30 }
31 
32 #define _(s) gd::GetTranslation(u8##s)
33 
34 #else
35 // When compiling without Emscripten,
36 // just return an untranslated gd::String.
37 
38 // Create a new macro to return UTF8 gd::String from a translation
39 #if defined(_)
40 #undef _
41 #endif
42 #define _(s) gd::String(u8##s)
43 
44 #endif
45 
46 #endif // GDCORE_LOCALIZATION_H
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24