Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 327
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: Thu Aug 21 01:21:49 CEST 2025

Total time taken to generate the page: 0.04100 seconds