Blame me all you will, it won't do you any good...
8-)Although in this case you're absolutely right. It looks like I always tend to forget to update the plugin function when I'm modifying the main one... That's valid for both CSS and JS. OTOH, I've long thought we really should merge both functions, even if it means having a slower function overall, because it'd be easier to update altogether.
So... I've updated the plugin function, not much to do, only had to add a global and an extra line to determine the language.
However, I'm not sure I'm "doing it right", even if it works... From what I understand in my code, Wedge first determines if the current JS file has language strings in it (!empty($settings['js_lang'][$id]]). If yes, it adds the language to the filename (but only if it's not the default language, i.e. English here and French on my local install). Then it checks for the file's existence, and if not there, it regenerates it. Only, that's only during regeneration that the file has a @language tag, and thus fills in the js_lang array with $id... OOPS.
Fact is, it WILL work, but NOT on the first request, but it won't even be noticeable if the first request is done by someone who's using the default board language... (Because in any case it'll have the same filename.)
Is it worth fixing or not?
It can be fixed, I'd think, by fudging the language name at the end of $id in wedge_cache_js, and obviously by making $id a pass-by-ref variable in the param list. It's not very pretty, though... I could also pass the language name in the param list but it's already very long as it is...
The more I see that caching function, the more I'm scared by the sheer complexity of it, although it's nowhere near that of Class-CSS's... Then again, they do their job
:PIn theory, the add_js_file and add_plugin_js_file should behave consistently from calling perspective, i.e. they add the file requested. If the backend wants to perform some magic, it should do it consistently the same for both.
Sure it should.
Then again, I don't tend to use plugins a lot... So I forget a lot, too.
BTW, Dragooon, I internally renamed Dragooon:MultiAttach to Wedgeward:MassUpload, is that alright with you? I'm not committing that without your permission, obviously, but I think we should have as much 'Wedgeward' plugins as possible, and this one would be a good example, having been partly developed by myself.