exomia / language

support different languages in your application

Home Page:https://exomia.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Information

exomia/language support different languages in your application

Installing

[Package Manager]
PM> Install-Package Exomia.Language

Example

static void Main(string[] args)
{
	ITranslator translator = new Translator(".", "en");
	translator.Load("example.phrases");
	//translator.Load("example2.phrases");

	Console.WriteLine(translator.Format("here we go... %t", "hello world"));	//here we go... Hello World
	Console.WriteLine(translator.Format("%T", "say", "exomia", "hello world"));	//exomia say: 'Hello World'
	Console.WriteLine(translator.Format("%t", "say2", "exomia"));			//exomia say: 'this is an example'

	Console.ReadKey();
}

example.phrases

"phrases"
{
	"hello world"
	{
		"en" "Hello World"
		"de" "Hallo Welt"
	}
	"say"
	{
		"en" "{0} say: '{1:T}'"
		"de" "{0} sagt: '{1:T}'"
	}
	"say2"
	{
		"en" "{0} say: '{1:example}'"
		"de" "{0} sagt: '{1:example}'"
	}
	"example"
	{
		"en" "this is an example"
		"de" "dies ist ein Beispiel"
	}
}

Social

Discord Twitch

About

support different languages in your application

https://exomia.com

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:C# 100.0%