Define a dynamic 'basePath' environmental variable without the locale
Check out craft-multi-environment; even if you don't use it, you might crib some of the ideas from it.

For instance, how the basePath is determined.