Old 19th September 2009, 14:13   #1
TheSaw
Senior Member
 
TheSaw's Avatar
 
Join Date: Apr 2009
Posts: 342
Send a message via Yahoo to TheSaw
Winamp Translation

Hy,
I've been reading some articles about Winamp's translation system, but I need to clarify a few things. Is there some step by step tutorial or something like that to look at, or where should I start?

If I want people to translate my plug-in, can I distribute these .wlz files separately, or do I need to include them in the same package with the whole Winamp translation? Do I include only the stringtable in the resource file, or all the dialogs? Will Winamp load these, or should I load each string separately from the string table?
TheSaw is offline   Reply With Quote
Old 21st September 2009, 20:00   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
http://xlat.meggamusic.co.uk/winamp/docs/xlat/xlat.html
has information about the wlz format (basically a renamed zip with .lng and other files stored inside it like skins).

the lng file is a resource only dll file with relevant resources in it which are then used (if present vis the look-up process) otherwise the resources are the same as from your plugin dll.

stringtable item 65535 is essentially a basic requirement as an identifier of the plugin for the localisation process. it holds a guid string generated via guidgen. it's best to have a look at an existing .lng file like those from the winamp essentials pack which are generally small scale so easier to look through.

as for distribution, that basically falls on the shoulders of the language pack authors to include the .lng files unless you store them in their own folder (like i used to do with my projects before the Winamp 5.5). if the plugin is good enough or gets the interest from key localisers then you'll tend to find it becomes part of the language pack distribution.

from memory there is enough information in the code examples for using api_language (all of the files should be in place) and it all has relatively easy to use macros for access the different modes as needed.

-daz
DrO is offline   Reply With Quote
Old 23rd October 2009, 12:30   #3
Koopa
16-Bit Moderator
 
Koopa's Avatar
 
Join Date: Apr 2004
Posts: 4,341
Well, I agree with the above post. If a plug-in is really useful/popular, then there is a good chance, that I'd include it to my wlz file.

I did this in the past too. Good stuff gets attention, this is why most translators already ship Essentials Pack translations in their wlz files.

The WavPack author added a lng based translation too, nearly all language pack authors already ship a translation for the plugin in their wlz file.

Quote:
I or do I need to include them in the same package with the whole Winamp translation?
One of the main reasons, why I like the wlz system is, that it's not possible for others to include additional files to the wlz. The language pack author is the driver and has full control over it.

If other translators would add additional files to my wlz file, I would loose any control. Then we cannot talk about a languge pack anymore.

The language packs are one package from one author. The advantage is that all strings harmonies together.

If someone else would add another language file, and may uses different grammar/translations, it wouldn't fit with the rest of the package.

Another issue is, that people would blame the wlz author, if something in the additional file wouldn't fit with the rest of the translation.

You have no clue how many mails I get related to the translation.

Translation is a hard process, different people have different translation styles.

I just can guarantee for a high quality language pack, if I have full control.

You could compare it with skins, I doubt that any skin author would be happy, if other people would patch his skin and add additional stuff.

As for your taskbar plugin, it's very popular (already got a few requests to add it to Essentials Pack) and if you ever decide to use the lng based translation, I'd probably add it to my wlz file too.

-Chris
Koopa is offline   Reply With Quote
Old 29th October 2009, 14:23   #4
TheSaw
Senior Member
 
TheSaw's Avatar
 
Join Date: Apr 2009
Posts: 342
Send a message via Yahoo to TheSaw
Hm, I've managed to look into them at that point, and it didn't seem to hard to do, but wasn't sure if the change (pretty big one, coding-wise) would be worth it. I mean I'm not sure how much would I have to change around... loading the file, shipping the files with the installer etc. It's prolly not that hard, but since I don't know that much about the whole system, I'm a bit skeptical

I'll look into it more and see what's it all about.

Winamp integration plug-in with Windows 7

If you like this plug-in, why not buy me a coffee to keep me awake to work more on it?

TheSaw is offline   Reply With Quote
Old 29th October 2009, 16:55   #5
Koopa
16-Bit Moderator
 
Koopa's Avatar
 
Join Date: Apr 2004
Posts: 4,341
The localized files would be shipped in the wlz files from the translators and not in your installer.

All you have to provide is an English example lng file, which is the fundamental component for other translators. Just to make this clear.
Koopa is offline   Reply With Quote
Old 29th October 2009, 17:44   #6
TheSaw
Senior Member
 
TheSaw's Avatar
 
Join Date: Apr 2009
Posts: 342
Send a message via Yahoo to TheSaw
Okay, so what about the existing translations? Can I just convert them to this format, and "someone" will include them in the pack, or the "new" translators will re-translate them?

Winamp integration plug-in with Windows 7

If you like this plug-in, why not buy me a coffee to keep me awake to work more on it?

TheSaw is offline   Reply With Quote
Old 29th October 2009, 18:49   #7
Koopa
16-Bit Moderator
 
Koopa's Avatar
 
Join Date: Apr 2004
Posts: 4,341
Should be possible to convert the strings from your ini based translations to the lng format, since you know, what string is related to which translation string.

Some of your existing translations were already made by official translators. E.g. the Polish Winamp translator made the translation for your plugin.

The big advantage is, that the taskbar plugin translations would perfectly fit with the rest of the Winamp translation.
Koopa is offline   Reply With Quote
Old 29th October 2009, 22:00   #8
TheSaw
Senior Member
 
TheSaw's Avatar
 
Join Date: Apr 2009
Posts: 342
Send a message via Yahoo to TheSaw
Okay, I don't have time in the weekend, but I'll look into this next week, and try to convert it to the "official" translation system

Thanks. (I'll ask here if something went wrong :P)

Winamp integration plug-in with Windows 7

If you like this plug-in, why not buy me a coffee to keep me awake to work more on it?

TheSaw is offline   Reply With Quote
Old 1st November 2009, 22:48   #9
DrO
 
Join Date: Sep 2003
Posts: 27,873
there's nothing stopping things being left in an ini file setup (is how my jtfe plugin and few others still are since they pre-dated the 5.5+ WLZ support and i don't have the time/resources to migrate things now). since you could have your code look in the exported language folder (see IPC_GETLANGUAGEPACKINSTANCE) for an 'auto' or some other specifically named file and use that if found otherwise use a custom file as per the user's decision (like the droplist i have in the jtfe plugin).

yes it's nicer to have a proper .lng file (especially when dialogs are concerned) but that can be worked around if using a .ini file setup (as well as having it work correctly with unicode strings).

-daz
DrO is offline   Reply With Quote
Old 2nd November 2009, 21:11   #10
TheSaw
Senior Member
 
TheSaw's Avatar
 
Join Date: Apr 2009
Posts: 342
Send a message via Yahoo to TheSaw
Hm, really? Can you elaborate on this? I mean on the "being left in an ini file setup".
For my plug-in the dialog isn't an issue, it's big enough to fit any language I think. Also, the .ini file supports right-to-left languages, the dialog modifies according to that, and full Unicode support.

Winamp integration plug-in with Windows 7

If you like this plug-in, why not buy me a coffee to keep me awake to work more on it?

TheSaw is offline   Reply With Quote
Old 4th November 2009, 22:51   #11
Koopa
16-Bit Moderator
 
Koopa's Avatar
 
Join Date: Apr 2004
Posts: 4,341
I guess he means, that you could add both things.

Leave the current translation files as is and ship all the localization files in installer, like you did in the past.

Additionally you can add wlz based language pack support.

Make that the plugin first checks for a language file in the extracted wlz folder.

So to explain it more simple:

Dro's plugins have a dropdown list. The list shows all available language files.

The language file, which is part of the wlz language packs (extracted in a temp folder) is shown as 'Auto' entry in the dropdown list. The other entries, like e.g. 'Deutsch' are language files, which are part of the Jump to File Extra installer (installed in Winamp program folder).

Jump to File Extra checks, if a jtfe_auto.ini was found in the extracted temp wlz folder. Then it automatically enables the auto mode.

If a wlz doesn't provide a language file, it simply would be English and the user can set the language via the dropdow. list.

I hope I have't confused you.



So 'Auto' and 'Deutsch' could be both German language file. 'Auto' is the file, which comes from my wlz language pack, while 'Deutsch' could come from the German file, you're already shipping in your installer.
Koopa is offline   Reply With Quote
Old 5th November 2009, 12:25   #12
TheSaw
Senior Member
 
TheSaw's Avatar
 
Join Date: Apr 2009
Posts: 342
Send a message via Yahoo to TheSaw
Okay, this made it almost clear
So, few more questions left: I load and initialize the service api, and I've found the macros to use to get the strings...
How can I check if a localization was found?
The macros are a bit confusing, which one should I use in which situation? I'm mainly referring to the "need it to fallback to a different module" thingy, and the memory freeing of these strings. Am I responsible for deallocating the memory?

Thanks.

Winamp integration plug-in with Windows 7

If you like this plug-in, why not buy me a coffee to keep me awake to work more on it?

TheSaw is offline   Reply With Quote
Old 5th November 2009, 16:44   #13
Koopa
16-Bit Moderator
 
Koopa's Avatar
 
Join Date: Apr 2004
Posts: 4,341
I hope DrO replies and gives you a better explanation.

In the meantime, you may want to take a look at this:

http://www.hydrogenaudio.org/forums/...pic=64560&st=0
Koopa is offline   Reply With Quote
Old 6th November 2009, 09:31   #14
TheSaw
Senior Member
 
TheSaw's Avatar
 
Join Date: Apr 2009
Posts: 342
Send a message via Yahoo to TheSaw
Well you've said in that thread that an .ini file can be a valid language file for the pack. I don't want the translators to modify my dialog, I think it fits the needs of all languages (If not, I'll make changes so it will). If this is the case, will the .ini file strings be accessible through the same language service api? Also, how will it find the correct file, I understood that's done via the 65535 string entry if it were a string resource?

Winamp integration plug-in with Windows 7

If you like this plug-in, why not buy me a coffee to keep me awake to work more on it?

TheSaw is offline   Reply With Quote
Old 6th November 2009, 11:04   #15
Koopa
16-Bit Moderator
 
Koopa's Avatar
 
Join Date: Apr 2004
Posts: 4,341
Yes, the wlz system can use ini files as well. No need to use a lng file. Jump to File, Time Restore and other of DrO's plugins use ini files as well.

The advantage is that you can use both, your current localization files and the 'auto' file, provided from the wlz archive, which will be automatically loaded if it was found.

Sadly, there is no real documentation for developers, which explains the wlz system in general.

For technical infos wait for a reply from DrO, since he did the whole wlz system and he uses the auto mode in some of his plugins too.
Koopa is offline   Reply With Quote
Old 6th November 2009, 22:37   #16
DrO
 
Join Date: Sep 2003
Posts: 27,873
i'll do a full reply to all of the points raised at the start of next week (oh i know how to use my time off work for fun...)

-daz
DrO is offline   Reply With Quote
Old 7th November 2009, 15:57   #17
TheSaw
Senior Member
 
TheSaw's Avatar
 
Join Date: Apr 2009
Posts: 342
Send a message via Yahoo to TheSaw
Okay, no rush

Winamp integration plug-in with Windows 7

If you like this plug-in, why not buy me a coffee to keep me awake to work more on it?

TheSaw is offline   Reply With Quote
Old 8th November 2009, 22:23   #18
Ruzzz
Junior Member
 
Join Date: Nov 2009
Location: Ukraine
Posts: 24
I am also interested in this topic, if possible, create a FAQ
Ruzzz is offline   Reply With Quote
Old 13th December 2009, 12:43   #19
TheSaw
Senior Member
 
TheSaw's Avatar
 
Join Date: Apr 2009
Posts: 342
Send a message via Yahoo to TheSaw

Winamp integration plug-in with Windows 7

If you like this plug-in, why not buy me a coffee to keep me awake to work more on it?

TheSaw is offline   Reply With Quote
Old 13th December 2009, 20:37   #20
DrO
 
Join Date: Sep 2003
Posts: 27,873
is delayed until after the 5.57 release due to some changes made that need to be included in the documenation (like the directory scanning changes made).

-daz
DrO is offline   Reply With Quote
Old 16th December 2009, 22:45   #21
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,057
I can put together a quick code sample for using the WLZ system (with the 5.57 change for third parties), unless you're feeling particularly inclined to do it, DrO.
Benski is offline   Reply With Quote
Old 16th December 2009, 22:53   #22
DrO
 
Join Date: Sep 2003
Posts: 27,873
already have a basic sample and stuff for the wiki 70% done, just need to finish off and put out into the wild

-daz
DrO is offline   Reply With Quote
Old 21st January 2010, 11:01   #23
DrO
 
Join Date: Sep 2003
Posts: 27,873
Language Pack Tool & Example Project Thread

-daz
DrO is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump