The kingdom eventually became part of the polyglot Austro-Hungarian Empire , which collapsed during World War I .