Optical properties of localized excitons in nanostructures: Theoretical aspects