Shoutbox

Multi Language class for scripts (request) - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Multi Language class for scripts (request) (/showthread.php?tid=62784)

Multi Language class for scripts (request) by Menthix on 07-07-2006 at 10:36 PM

It would be nice if somebody could create a class that can handle scripts in multi languages in a good and easy way.

The problem I see now is: Somebody releases a nice script in English and it gets added to the download DB. A few days later somebody downloads the English version, translates it to Spanish, and submits a new .plsc file... same script but this time in Spanish. What I do now is mail back the creator of the Spanish version and tell him to contact the original (English version) creator so he can make a new version that is multi-language. Because having 2 separate scripts for 2 languages only makes things harder for updates.

However, It looks like things like this will happen more and more often, and it can be hard for some coders to turn their script multi-language. So I was hoping someone could write a class which makes this stuff easier for them.

Something that works with languagefiles (similar to Plus! itself) would be nice. Would be great if this class takes care of loading and reading from the language files, and a menu so users can change language. All that coders would have left to do is replace all their text strings and reference it to the language class.

Would like to hear ideas from people, and those who would want to make this. Saw somebody talk about it in another topic, but don't recall which one or who it was. But everyone is welcome to create it :).


RE: Multi Language class for scripts (request) by RaceProUK on 07-07-2006 at 10:50 PM

I think that if the script developer is serious about translations, they'd have thought of a solution long before getting to the submission stage. But still, it's a good idea, especially if it's a 'drop-in' class that any developer can use.

Or maybe Google has something.


RE: Multi Language class for scripts (request) by J-Thread on 07-07-2006 at 10:54 PM

I already thought about this, and I even thought about making a class that can also acces the MP!L language strings and the WLM language strings. So you would be able to grab the basic strings like "Nickname", "Yes", "No", "Sign off" etc directly from WLM / MP!L. In that way those words will always appear in the users language, without having to translate it yourselves.

It would of course bring new problems, for example about design, and scripts in half english / half otherlanguage, but I think it can still be usefull...


RE: Multi Language class for scripts (request) by deAd on 07-07-2006 at 11:00 PM

Hmmm, good idea. I'm starting to work on this :) and I like your idea too, J-Thread :)


RE: Multi Language class for scripts (request) by cooldude_i06 on 07-07-2006 at 11:45 PM

This would be easy enough for strings used in the jscript files, but what about the captions stored in interface xmls???


RE: Multi Language class for scripts (request) by deAd on 07-07-2006 at 11:46 PM

Yeah, I was just thinking about that. You'd have to use SetControlText to change the controls' text to something in the file...


RE: Multi Language class for scripts (request) by cooldude_i06 on 07-08-2006 at 12:33 AM

Is there a way to include variables in XML. Perhaps if all the variables were defined during the start of the file, or even in a seperate file then somehow imported, it would make translations much easier.


RE: Multi Language class for scripts (request) by deAd on 07-08-2006 at 01:38 AM

It's pretty much done. Tomorrow I'll be squashing some bugs and testing it more thoroughly, maybe writing a tiny bit of documentation :P...it's small though. It is very simple to use, and relies on external files. It has a function to open windows too, and automatically translates those, based on another file telling what controls to translate (y)...:)


RE: Multi Language class for scripts (request) by Dhaya on 07-08-2006 at 09:09 AM

great news deAd ^^ If this works correctly it will be really usefull for us !


RE: Multi Language class for scripts (request) by deAd on 07-08-2006 at 01:02 PM

It works very well. You can insert comments in the text files too, so they don't get super-confusing to edit ;) ...


RE: Multi Language class for scripts (request) by -dt- on 07-08-2006 at 01:19 PM

if we could add our own doctype to the files we could use the dtd file to define entities and have the xml engine automaticly translate it :P


RE: Multi Language class for scripts (request) by deAd on 07-08-2006 at 01:26 PM

Since it only reads files in a specific format, (very simple format ;)), it won't be possible. You can use whatever filekind that you want, but they must be formatted the same.

However, by providing the Window files, you can use the CreateWnd function to automatically open/translate the windows. :)


RE: Multi Language class for scripts (request) by -dt- on 07-08-2006 at 05:44 PM

Well Ive finished my translator class :P its quite powerful and Ive written up some text about how to use it as well.


The Class its self
http://svn.thedt.net/www/cgi/viewcvs.cgi/scripts/...ass.js?view=markup

The example Files
Read the example jscript file for information on how to use this


The example interface file
http://svn.thedt.net/www/cgi/viewcvs.cgi/*checkou...-type=text%2Fplain


The example jscript file
http://svn.thedt.net/www/cgi/viewcvs.cgi/scripts/...ain.js?view=markup

The example Translation file (save to /languages subdirectory)
http://svn.thedt.net/www/cgi/viewcvs.cgi/*checkou...-type=text%2Fplain


RE: Multi Language class for scripts (request) by deAd on 07-08-2006 at 05:54 PM

I've finished mine too, I'm currently writing how to use it. I see yours is for windows...mine does some things with windows, but it also does just any strings too :)


RE: Multi Language class for scripts (request) by -dt- on 07-08-2006 at 06:16 PM

quote:
Originally posted by deAd
I've finished mine too, I'm currently writing how to use it. I see yours is for windows...mine does some things with windows, but it also does just any strings too :)
mine is for any string as well if you read it :P
RE: Multi Language class for scripts (request) by deAd on 07-08-2006 at 06:49 PM

Oh, didn't notice that. Well anyways, mine is done. :) *releases* it works differently than yours, but it still works. =)


RE: Multi Language class for scripts (request) by J-Thread on 07-08-2006 at 08:26 PM

-dt-'s class: [Developers] Translator Class
Dead's class: [Developers] Multiple Language Class