It's certainly not recommended for localization, as in your example.
The main thing to consider is how much of the code is going to be similar versus different in the specialized versions of the class. If only a small amount of code is different, or if only data is different ("Hello" vs "Salut"), there are better ways.
One case where I might consider conditional declaration of classes is if I'm providing functionality on two different OSes, and getting that functionality is very different between the two. As an example, maybe I'm trying to drive iTunes from a script, and on MacOS I'm using AppleScript to drive it, but on Windows I have to use COM. I might create a wrapper class that the rest of my code could use without caring about which OS was in use.