I've decided to start developing multilingual web site. Now I'm thinking about the structure. The idea is to use a simple algorithm to find out what language is most interesting to the visitor when he makes his first visit to the root page, and then forward him to the corresponding address, for example,
http://example.com/en/ for English-speaking audience and
http://example.com/ru/ for Russians.
The question is, how search engines react on such redirect? If this approach does not take away site's reputation, which redirects should I choose: 301 or 302?
I would be very grateful for the reasoned response.