Added onlyCheckLanguage check (not used though).
As for moving main layout loading down the locale specific langinfo.xml check - the main layout must be loaded in any case otherwise keyboard dialog will not work.