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

Home » U++ Library support » U++ MT-multithreading and servers » Witz internationalization
Re: Witz internationalization [message #39562 is a reply to message #39559] Sat, 30 March 2013 10:16 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1796
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Zbych,

I wrote almost exactly the same function a while back Smile
Quote:

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

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

I had no problem with this implementation, but I haven't use it too extensively, so I probably wouldn't notice cache problems. Also, it is only useful for shorter strings, anything bigger is better to be placed in separate files (*.xy-xy.witz).

User language can be detected by parsing the Accept-Language HTTP header. However, it is always good idea to let the user override the setting manually (e.g. for cases when they use someone else's computer with different language settings).

Best regards,
Honza
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Cant connect but dont get an error
Next Topic: Is there a Threadpool in U++?
Goto Forum:
  


Current Time: Fri Sep 25 09:14:46 GMT+2 2026

Total time taken to generate the page: 0.00676 seconds