Multi-lingual site without subfolders Would it be possible to have a cleaner site setup without all those 'locale' subfolders in the webroot? Somehow it looks like there's something similar already done here (https://github.com/craftcms/cms/tree/master-v2/src/services/HttpRequestService.php#L99) if I'm not wrong, wouldn't it be nicer to also just remove the locale if one is detected?

Bonus question :) :
Where in the hell is the actual Entry Slug -> Template resolving done? I know there's a lot of stuff happening with filters, action and resource requests. The closest I could get is that here the template/render controller gets triggered (https://github.com/craftcms/cms/tree/master-v2/src/framework/web/CWebApplication.php#L274) which in the end resolves to the action render method in the TemplatesController (https://github.com/craftcms/cms/tree/master-v2/src/controllers/TemplatesController.php#L50), already with the correct $template parameter set. 

Could someone guide me in a direction here?
I'm not exactly sure what you are trying to achieve, but here is a way to have unlimited locales with only a single subfolder in your public root directory.


Put all of your locale subfolders into a single folder, called locales for example. So your directory structure would be:

public/locales/de/
public/locales/es/
public/locales/fr/

Make sure you update the craft path in each locale's index.php file accordingly:

$craftPath = '../../../craft';

Then you just need the following code in your root .htaccess file to redirect to the appropriate subfolder:

# Redirect locales
RewriteCond %{REQUEST_URI} ^/(de|es|fr)/ [NC]
RewriteRule (.+) /locales/$1 [QSA,L]