Multi-language support

If you want to add support for several languages to the program, you need to placethe translation files in the "strings" folder of the resources.Translation files must have the "rui" extension and the following format

strings {
	 = _{
		 = ,
		 = ,
		…
	},
	<язык 2> = _{
		 = ,
		 = ,
		…
	},
	…
}

If the translation for each language is placed in a separate file, then the following format can be used

strings: {
	 = ,
	 = ,
	…
}

For example, if all translations are in one file strings.rui

strings {
	ru = _{
		"Yes" = "Да",
		"No" = "Нет",
	},
	de = _{
		"Yes" = "Ja",
		"No" = "Nein",
	},
}

If in different. ru.rui file:

strings:ru {
	"Yes" = "Да",
	"No" = "Нет",
}

de.rui file:

strings:de {
	"Yes" = "Ja",
	"No" = "Nein",
}

The translation can also be split into multiple files.

Translations are automatically inserted in all Views.

However, if you are drawing text in a CanvasView, then you must request the translation yourself.To do this, there is a method in the Session interface:

GetString(tag string) (string, bool)

If there is no translation of the given string, then the method will return the original string and false as the second parameter.

You can get the current language using the Language() method of the Session interface.The current language is determined by the user's browser settings.You can change the session language using the SetLanguage(lang string) method of the Session interface.