Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (RealSerious3D, AndrewAMD, BrainSailor, 1 invisible), 1,233 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Localized Strings for your App #368936
04/29/11 17:40
04/29/11 17:40
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
ENGLISH:
Hey Guys, maybe you thought about a multilingual support for your game or application. Here is a solution which uses the standard windows language as default! So you don't need to create any language settings. This system uses the windows API functions, so you need to include windows.h
You need a resource editor to create your strings, but is is really useful to store many strings which should be localized.

GERMAN:
Hey Leute, nochmal ein neues Snippet von mir. Diesmal geht es um multilinguale Spiele und Anwendungen. Dieses Snippet hier nimmt die Strings aus einer DLL und verwendet gegebenenfalls die Systemsprache für euere Anwendung. Wenn ihr also euere Anwendung in Deutsch und Englisch vertreiben wollt, müsst ihr nichtmal ein Sprachsetting machen, das System übernimmt einfach die passende Sprache in euerer Anwendung.
Man benötigt einen Ressourcen-Editor, um eine solche Datei zu erstellen, aber es gibt sehr viele davon.

CODE:
Code:
#include <acknex.h>
#include <default.c>
#include <windows.h>

char tmpString[256];	//define the string
function main()
{	
	HINSTANCE instance = LoadLibrary("stringTable.dll");	//Need to load the library in memory
	if(instance)
	{
		HMODULE mod = GetModuleHandle("stringTable.dll");	//You need the module handle to get strings
		if(mod)
		{
			int length = LoadString(
				mod,			//the module handle
				0,				//string id from table
				tmpString,	//pointer to char array
				256			//The max. string length
				);
			error(tmpString);	//print the string
		}
		else
		{
			error("Module not found!");	//print error message
		}
	}
	else
	{
		error("Library not found!");
	}
}



This example uses a library called stringTable.dll
You can get this here
Dieses beispiel benutzt eine Bibliothek names stringTable.dll
Sie kann hier heruntergeladen werden.

String Tables:

You have to create string tables in the library with an resource editor. If you don't know how, read the manual of your resource editor or ask me

Man benötigt String Tables in der Bibliothek. Diese erstellt man mit einem Resourcen-Editor. Wenn man nicht weiß wie, einfach im Handbuch des Resourceneditor nachschauen oder mich fragen.

Resource Editor:
ResEdit

Last edited by Richi007; 06/20/11 20:58. Reason: Delete the link in the source code window

Visit my site: www.masterq32.de
Re: Localized Strings for your App [Re: MasterQ32] #373317
06/09/11 13:16
06/09/11 13:16
Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Minamato Offline
Junior Member
Minamato  Offline
Junior Member

Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
link down - can you please reupload it? and thanks for that great contribution =)

Re: Localized Strings for your App [Re: Minamato] #373382
06/09/11 20:16
06/09/11 20:16
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
link changed, now it's the direct link


Visit my site: www.masterq32.de
Re: Localized Strings for your App [Re: MasterQ32] #373597
06/11/11 11:47
06/11/11 11:47
Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Minamato Offline
Junior Member
Minamato  Offline
Junior Member

Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
thank you =)


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1