<p>I can’t say whether China or Japan would be better for you personally, but if you choose China then you’ll definitely want Beijing. There’s no single Chinese language, it’s kind of like how the Romance languages of Europe have similar traits despite being different languages. Shanghaiese is the language of only a small part of the country outside the city; Beijing Mandarin is the official language of the country. Most people in China are learning Mandarin even if it’s not their native dialect.
Shanghai is apparently a nicer city though, so if you don’t mind staying in that little section of the country it’d be cool.</p>