Any weapon that can be sheathed, and relatively unobtrusively, is going to some real-world advantages that D&D typically doesn't model. If you want swords to be more popular, modeling those advantages in the system would be one way to do it, aside from any Type 1 or Type 2 considerations.
The historical soldier going to war is often going for something like the bow, spear, blade trilogy. There's something to use at range, something for the heavy formation, serious fighting, and then something for when the formations break down or that spear or polearm breaks. Not to mention, you can walk around with that blade sheathed in the more dangerous parts of town without too much trouble, and might even be permitted to carry it into social settings. (Things like great swords or battle axes sheathed over the back will have some limitations compared to smaller blades, but not as great as polearms.) Now you can let polearms and bows hurt like they ought to.
That address "melee versus ranged". Now, if you want to work the fantasy angle into that reasoning, make the means to deliver powerful spells require similar troubles. That big mages staff you need to shoot the heavy mojo is like a polearm, in taking up both hands and its socially inappropriate in many settings. For the little stuff, you use a small wand (dagger equivalent)--or even better, an enchanted, specially prepared blade.
Perhaps going more afield, mages that don't use such an encumbering means of their power have obvious transformations--not so bad for dungeons or dark alleys, but even worse for social situations. This is to socially acceptable magic as "sharp claws" are to socially acceptable weapons.
There is no free lunch. Apply the same logic to magic (even if using different flavor), and swords start looking pretty darn spiffy.
