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++ MT-multithreading and servers » Witz and map variable
Re: Witz and map variable [message #37990 is a reply to message #37987] Tue, 27 November 2012 12:29 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1791
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Zbych wrote on Tue, 27 November 2012 10:50

Thanks for reply.
I know that I can pass the map from handler. The problem is that this map will be different for every language and I would like to keep all language things in one place (witz scripts).


Ok, I think I understand now. I think your best chance if you really want to keep it that way is to create a witz function, something like translate(lang,word1,word2,word3,...) that would just return the parameter according to the value of lang. But I think this is not really the correct way, as it might require a lot of work when adding support for new language. You would have to modify all of your templates to add another parameter, even if the same word would be used repeatedly...

So what about a function that would utilize U++ internationalization capabilities? It could behave exactly as t_() macro, then you could just write t_("String in English") and it would return the correct translation based on .t files. I know it violates your wish to "have everything language specific in witz", but .t files are designed for this, so it might not be so bad idea Wink

I assume you are using the .lang/.__lang__ variables and language specific templates (as described in chapter 11 of the tutorial), right?

Zbych wrote on Tue, 27 November 2012 10:50

Is it possible to create new variables inside witz scripts?

No, quoting from the manual:
Quote:

Witz primary values come from shared variable space of Skylark handler; the only other way to define a new variable is by using for statements.


Honza
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to close a Thread?
Next Topic: What's wrong with this code?
Goto Forum:
  


Current Time: Sat Jul 19 05:05:22 CEST 2025

Total time taken to generate the page: 0.03995 seconds