U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Skylark functions/links
Re: Skylark functions/links [message #42924 is a reply to message #42922] Mon, 14 April 2014 18:14 Go to previous messageGo to previous message
Zbych is currently offline  Zbych
Messages: 332
Registered: July 2009
Senior Member
Take a look at this thread:

http://www.ultimatepp.org/forums/index.php?t=msg&th=7545 &goto=39562&#msg_39562

You have to create function body and register it:

Value translate(const Vector<Value>& arg, const Renderer *)
{
	if(arg.GetCount() == 1 && IsString(arg[0]))
		return GetLngString(GetCurrentLanguage(), (String)arg[0]);
	return arg[0];
}

INITBLOCK {
	Compiler::Register("t_", translate);
};


And after that you can use it in witz:
$t_("some text")

[Updated on: Mon, 14 April 2014 18:21]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ParseSvg.cpp:506:35: error: conversion from 'Upp::String' to non-scalar type
Next Topic: Witz template cryptic error messages
Goto Forum:
  


Current Time: Sat May 30 15:25:58 GMT+2 2026

Total time taken to generate the page: 0.00461 seconds