What was China fighting for in World War I or 2?

China didnt fight in world war 1, and japan was invading and masacreing the Chinese in ww2.