split common code from read_available_langpacks function
Added langlist command