Add class to check if repo is valid

Clean up code in l10n-init, remove duplicated code in checkvariables.