Discretization strategy for linear ill-posed problems in variable Hilbert scales