View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002544||MediaMonkey (current)||Framework: Scripts/Extensions||public||2006-07-13 03:10||2010-04-25 11:50|
|Summary||0002544: Framework: New-style script packaging needs to have localization|
|Description||Any scripts created by end users using the new script packaging guidelines should have a defined means of being localized, along with a means of appearing in whatever language the user is running MM in--assuming the script has been localized to that language.|
Such a framework will allow script owners to manage localization of their scripts.
|Tags||No tags attached.|
|Fixed in build|
To improve localization feature in Scripts/Extensions we can implement something like this example script where MM will load translation file accordingly:
res = SDB.MessageBox(SDB.Localize("Select tracks to be exported, please."), mtError, Array(mbOk))
test.mml (mml= MediaMonkey localization file):
Select tracks to be exported, please.=Wählen Sie Spuren aus, die bitte zu exportieren sind.
Select tracks to be exported, please.=Choisissez des empreintes à être exportées, s'il vous plaît.
Select tracks to be exported, please.=Wybierz utwory, które maj? by? wywiezione, prosz?.
Select tracks to be exported, please.=Vyberte skladby, které má být vyvezeno, prosím.
Url Encoded Strings maybe needed to exclude invalid ini characters " "=%20 and also few more things would be needed to be made SDB.Localize search MML file only if SDB.Localize ends without hange from MM selected localization/translation where Automated Proces will create <script filename>.mml will be created. Or maybe making Script Function SDB.LocalizeFile("<localization filename>")
Another Approach would be to use <script filename>.<MM Language Code>.mml
mmlocaltest.zip (679 bytes)
||Example of localized script function uploaded|
Your suggestion is very nice, but I don't understand what is a point of your example. If scripters need to write something like that, then this is nothing new, we already could use such approach. I was expecting that you would add some new method or another simpler way that we could use instead. I suppose that it would be the best if we could use existing SDB.Localize method for that instead of your lngtranslate function. So, the program could look if the script_name.lng.ini file exists and if exists it could try to find specified string and if it find it, the program will return translated text.
What would happen if I type some string which is already in MM base of translated words, e.g. SDB.Localize("Title")? I suppose you already have "Title" translated for all supported languages, so why scripters should create some new language file for words that are already translated? I am talking about a possibility to replace Basic, Details and Classification sheets with my own using new (v4.0) methods, and my new sheets would have labels with same strings as existing ones, i.e. "Title", "Artist", "Album"...