now i solved it basically, with
<% control Translations %>,<% if Locale == "locale %> and <% if hasTranslation(locale) %>
my original planning about the "languagebar" drifts a little bit from the result
Step1. "Getting the corect $Link per locale". 'Cause i havent found a function for me, which fits, i made it by using
<% control Translations %>
with that it gets the "correct" $link for each locale unsorted,. To get it "sorted", i made
<% if Locale == "en_GB" %>
<a href="$Link">
<img src... /></a>
and then further the other languages, so it is possible to fix the order of the locales,
<% end_control %>
But, what is, when there is no Locale Link for this page?
Step2. Pages, without a translation for a locale, it wouldn appear
to check, if a page, has a tranlation for that locale, for example
<% if hasTranslation(de_DE) %>
, if not, link with the "startpage" for this locale
<a href="$get_homepage_urlsegment_by_locale(de_DE)">
<img src"..."/></a>
Now it shows, first the links for the pages, with a translation for its locale, and then the links for the pages, without translation for its locale, at which is a link for the "startpage" for this locale.
But, the actually locale is not shown now in the bar.
Step3. displaying of the actual locale
to get this, i inserted before <% control Translations %> has begun, another
<% if Locale == "locale" %>
<a href="$Link">
<img src="...."/></a>
and at least, there is still a little problem, with hastranslation --> actual locale would be postet twice, therefor i made
<% if Locale != "en_GB" %>
<% if hasTranslation(en_GB) %>
<% else %>
<a href="......</a>
Now, in the language bar, the first locale, which is displayed, is the actual locale. Followed by the Pages, with a Translation for this page, and at least, the pages, without a Translation for this page, and this through the if requests sorted.
As posted it drifts a little bit from my planning. 'Cause i wanted the order of the locales completly fixed (for example, first always locale en_GB then de_DE and so on)
For Sure not the best solution, but a solution,
has somebody an idea for a better solution?
edit(forgotten): in page.php page_Controller
if($this->dataRecord->hasExtension('Translatable')) {
i18n::set_locale($this->dataRecord->Locale);
}
with that, every page "knows" its locale