Do I use Twig filters 'include' and 'extends' for localized site correctly? I use regular file names for template structure from documentation for clearer understanding.

I have the template structure:


_layouts

base.twig

_includes

header.twig
body.twig
foot.twig

index.twig
de

_includes

header.twig
body.twig
foot.twig

index.twig



So for top level domain, 'index.twig' extends 'base.twig' and 'base.twig' include 'header.twig','body.twig' and 'foot.twig'. 

For sub level domain (example.com/de), It's the same scenario as for top level domain.

All 'index.twig' files in all sub level domains extends the same file located at '_layouts/base.twig'.

The include filters look like this in my 'base.twig' template.

{% block header %}{% include '_includes/header' %}{% endblock %}
{% block body %}{% include '_includes/body' %}{% endblock %}
{% block foot %}{% include '_includes/foot' %}{% endblock %}

All work great, but did I use it correctly?

The thing that confuses me, is that I didn't have to copy '_layouts' folder with 'base.twig' file to 'de' folder, and modify paths in 'base.twig' for all include filters. Why is it so? Twig renders files of an active locale?
From the localization guide - When Craft is looking for a template, it first sees if a template with that path exists inside a directory named after the current locale, then for the actual path provided.

So in your case, when you're in the de locale, it would look for the following templates:


templates/de/_layouts/base.twig
templates/_layouts/base.twig


and


templates/de/_includes/header.twig
templates/_includes/header.twig


etc, using the first one that exists.

If there's little or no difference between how the site behaves in different locales (other than the translated strings,) then it might not be necessary to override whole templates like that, but it's great when you need it.