wmk

Translatable has a method to get the current Page in another locale. This should automatically consider Versioned

dorsetdigital

My first thought was to get all the locales, iterate through them and get the live pages for each:

  1. $allLocales = Translatable::get_allowed_locales();
  2. foreach ($allLocales as $locale) {
  3. Translatable::set_current_locale($locale);
  4. $allProducts = Versioned::get_by_stage('ProductPage', 'Live');
  5. <-- Loop through the products here and do some stuff -->
  6. }
dorsetdigital

It's a site I've inherited, so what I'm really trying to work out is whether I'm approaching this all wrong, if the data is just a mess or if there's some weird hidden stuff going on that doesn't belong there

dorsetdigital

Hi all. So.. with Translatable, if I wanted to get all the live pages of a certain class, in all their available locales, how would I go about it? No matter which way I try (looping locales, and looping pages inside that, looping pages and trying to get all the translations, etc.) I see to end up with draft pages, pages with some fields in the wrong language, etc.

wmk

Sounds like configuration issue? Or is the translated locale also published? Does it work in Stage mode?

Lorrain Fontaine

By the way the targeted URL seems right (when I inspect the element) so it looks like SS is just not setting the targeted locale in memory :x

Lorrain Fontaine

Hi everyone. I'm using the LocaleMenu from the Fluent documentation, but everytime I click a lang in it, it keeps reloading the current page without switching the locales. Has anyone already seen this ? I'm using a fresh installation of SS4.5.1 with the latest update of Fluent btw

tractorcow

or conversely if the developer has to deal with locale code + locale ID as a identifier everywhere, does it make sense either?

tractorcow

if the developer can't create multiple variants for a locale, does it make sense to limit that developer?