Localized orbitals from cluster to bulk calculations