How to output entries related to a locale, IF a section is targeted to all locales? The documentation doesn't say much about it, only How to access it.

What I'm trying to achieve here?

Display entries only related to a locale.



I'll present it you with an example.

There are 3 targeted locales enabled in 3 sections. 1 entry in each section, created by 3 local users. So math says, that one locale has 3 entries, where the whole example.com has 9 entries together.



So, When I try to index entries on selected section I get that:


example.com/section1/ -> all entries from all locales are outputted, because entries are targeted in all locales of a section.
example.com/locale1/section1/ -> the same situation as with example.com/section1/, except with two differences, that entries's URL has /locale1/section1/{slug} and the locale is matched with active one.


I've looked into database, and all entries published are linked with each locale, even when Local User1 published to Local1 only. If that is gonna work, I don't know, if that will have any impact on storage efficiency.
Craft always outputs entries in one locale only. If you really want to list all entries in all of their enabled locales you would need to explicitly query for them using the locale parameter and then merge the results.

What probably confuses you is that Craft automatically clones an entry on the first save to all other locales. Try to edit an entry / disable it for one locale only and see the differences on you index pages!

If you really don't get the locale specific content for your different URL formats

example.com
example.com/locale1

there probably goes something wrong with your setup. The first thing I would check is the index.php files (→ Localization guide – Step 5: Set up the files)!