View Issue Details

IDProjectCategoryView StatusLast Update
0002544MMW v4Framework: Scripts/Extensionspublic2010-04-25 11:50
Reporterrusty Assigned To 
PriorityhighSeverityfeatureReproducibilityalways
Status newResolutionopen 
Summary0002544: Framework: New-style script packaging needs to have localization
DescriptionAny 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.
TagsNo tags attached.
Attached Files
mmlocaltest.zip (679 bytes)
Fixed in build

Relationships

has duplicate 0005881 closedrusty Localization framwork for Scripts/extensions 

Activities

peke

2009-09-17 22:29

developer   ~0018879

To improve localization feature in Scripts/Extensions we can implement something like this example script where MM will load translation file accordingly:

test.vbs:
---
Dim res
res = SDB.MessageBox(SDB.Localize("Select tracks to be exported, please."), mtError, Array(mbOk))
---

test.mml (mml= MediaMonkey localization file):
---
[de]
Select tracks to be exported, please.=Wählen Sie Spuren aus, die bitte zu exportieren sind.

[fr]
Select tracks to be exported, please.=Choisissez des empreintes à être exportées, s'il vous plaît.

[pl]
Select tracks to be exported, please.=Wybierz utwory, które maj? by? wywiezione, prosz?.

[cz]
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

peke

2010-04-25 00:37

developer   ~0020128

Example of localized script function uploaded

zvezdan

2010-04-25 11:50

updater   ~0020130

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"...