and I rightclick SVN Commit... I type in a comment and select .pkgmeta click ok and it seems to work... I get a new revision in Wowace.com but it's not created a no-lib folder. I thought i followed the knowledgebase instructions to the letter but clearly not.
Could someone help please, I just want to get this project uploaded correctly and re-submitted for approval (was rejected for having libraries last time!!!)
I fixed some other issues for you as well. Also, you will need to enable localization on your addon, seeing as I added localization code...
Your OnEnable() error was because you had CallbackHandler-1.0 after your libs in the embeds.xml (which I took out) -- it should be right after LibStub. It caused the error because your code said "I'm a lib, and I want a callback. Um, what's a callback and how is it handled?" Now it says "I'm a callback handler. give me some callbacks." The lib responded with "Hey, I have one!"
Not sure if this was worth a new topic or not...
Anyway I've nearly fixed the addon and added in localization but for some reason 3 things aren't working
1) Localization... for example I have the code on Enable OIF:Print(L["Load"])
what happens is that when i reload the console I get the message Old Instance Finder: Load
instead of what I wanted which is Old Instance Finder: OIF Addon Loaded OK
The text is correct in the Localization.enUS.lua file yet I can't get it to work... this is the same for any of the L["......"] Commands L["Load"] = "OIF Addon Loaded OK"
2) Exactly the same as #1 but for BZ (babblezone)... it doesn't seem to be interacting with the library correctly, I've tried various things but I'm thinking it must be related to problem #1
3) I've kept the Callback handler in the same order that you put it in the TOC but it still throws the on-enable error. This doesn't affect the functionality but I'd rather not have any bugs in the code whether it works or not.
Any help you guys can give on sorting this out would be most welcome.
Fantastic on point 3... I'll try it tonight. (i'll also strip out the curse headers... good tip)
R12 that you downloaded is the latest version I have as my working copy.
When the addon loads I wanted it to display the appropriate "Load" message... therefore I asked it to print:
and I thought this would go to the localization and get the appropriate load message.
In /Locales/Localization.enUS.lua I have the following line:
L["Load"] = "OIF Addon Loaded OK"
so I expected the addon to report: Old Instance Finder: OIF Addon Loaded OK
however when I start up I actually see Old Instance Finder: Load
likewise when I find 12 people in Ulduar I want to use the following command
OIF:Print((L["MoreHits"]) :format(numofrunners, level, currentzone))
with the localization line:
L["MoreHits"] = "There are %s level %s's currently in %s"
to give the following output:
Old Instance Finder: There are 12 level 80's currently in Ulduar
but actually what I get is Old Instance Finder: MoreHits
so whenever it sees Print(L["abcdef"]) it just prints "abcdef" but doesn't go into the localization file to see what it should translate to.
Oops... it uploaded a nolib file but I'd checked the box so it still put them in... I'll fix that next time.
when you say...
OIF:Print(L["Load"]) ~= OIF:Print(L["OIF Addon Loaded OK"])
what I want is the following...
OIF:Print(L["Load"]) = OIF:Print("OIF Addon Loaded OK")
What I did was to look at EnsidiaFails (as well as others)... and you can see that they have a line in their localisation: L["noexceptions_desc"] = "No exceptions, every fail is a fail!"
and then in their base EnsidiaFails.lua code desc = L["noexceptions_desc"],
Ah, I follow your thinking. Unless you can replicate the masters, do it as simply as you can.
Your enUS localization page on your addon needs to get dumped, and rebuilt. When trying to learn, you have confused translation keys with the actual translations.
L["OIF Addon Loaded OK"] = "OIF Addon Loaded OK"
L["There are %s level %s's currently in %s"] = "There are %s level %s's currently in %s"
L["There is one level %s currently in %s"] = "There is one level %s currently in %s"
L["Number of dungeons to search is %s"] = "Number of dungeons to search is %s"
L["Old Instance Finder \\n Usage: /oif 80 to search for level 80s \\n or /oif 70 for level 70s etc."] = "Old Instance Finder \\n Usage: /oif 80 to search for level 80s \\n or /oif 70 for level 70s etc."
Take that lump of code exactly, just copy/paste, and tell your English page to import and DELETE all unused translations when prompted.
Leave the Localization.enUS.lua file alone as when I gave it to you last, as SVN commits will automatically update it for you when you add or delete phrases online. While you can change phrases, I found that to be prone to human error, and, at least for me, it was better to delete the old phrase and re-create it.
You will notice in the .toc file I put in r13 as the version; for your sanity, it is best to have the version match the alpha/beta/release naming you have on wowace. For the .pkgmeta, I cleaned up the spacing and re-organized it so all the Ace3 stuff comes before LibBabble and LibWho. Except for LibStub and CallbackHandler, then AceAddon, the order really doesn't matter, but it is cleaner to have the similar items together.
The bolded part was telling the Curse Packager that your key == translation, or
L["Bob"] = "Bob"
When you wanted
L["Bob"] = "Bob eats donuts"
There is two ways to deal with this: either take out the bold part or do what I did in your OldInstanceFinder.lua file and did
OIF:Print(L["Bob eats donuts"])
Which is much easier to bug fix.
Now, if you need to create new phrases on OIF's wowace localization page, take a look at it. There are only two things on that page that concern you since you are writing in enUS as the main language. The first section, and the tick box at the bottom for creating a new phrase.
Say you needed "Bob eats donuts" as a new phrase, along with "Mary prefers muffins", so you enter Bob eats donuts (notice there is no quote " symbols) in the top section, which is the key, leave the translation, or next section BLANK since you are using same-key-is-true, tick the box to create a new phrase, click Create, and repeat putting Mary prefers muffins in the top box, leaving the translation box BLANK again.
That is why you got "Load" instead of "OIF Addon Loaded OK" ... because with same-key-is-true, the Packager transated "Load" as "Load" and not what you wanted.
I did not make Adirelle's changes to your wholib in your OldInstanceFinder.lua so be mindful. The fix is on the first page of this thread.
Also, remember what I said about rebuilding your English page on wowace: there should be an option to delete unused translations when importing, and you want to copy/paste the code I gave you earlier, and dump everything you currently have, since none of it works as intended.
If you want to get a jump start on other localizations, create Localization.deDE.lua, Localization.koKR.lua, etc in your Locales folder, and populate them with
local L = LibStub("AceLocale-3.0"):NewLocale("OldInstanceFinder", "deDE")
if not L then return end
@localization(locale="deDE", format="lua_additive_table", same-key-is-true=true, handle-unlocalized="english")@
That is the German, deDE, example; change accordingly. What that code is saying is "deDe is not the default language, but if the WoW client is deDE, use these translations. same-key-is-true and if a translation is not found, use enUS instead".
BTW, I hope wearing the Wife Faction Tabard helped. :)