View more context

 

Chrissi

Can anyone help? Given a page, how can I see which locales the page is published in? (Fluent)

robbieaverill

something like this might work (untested):

  1. $page = SiteTree::get()->byID(123);
  2. $locales = Locale::get();
  3.  
  4. $localesPageIsIn = [];
  5. foreach ($locales as $locale) {
  6. if ($page->isPublishedInLocale($locale)) {
  7. $localesPageIsIn[] = $locale;
  8. }
  9. }
Chrissi

Nice! That did the trick (with if ($page->isPublishedInLocale($locale->Locale)) {)

fuzz10

Does anyone know whether it is possible to disable a locale in Fluent without actually erasing it ? I've tried unpublishing all pages, and that seems to work except it still produces "alternate" urls (both in the metatags and sitemap.xml). Erasing the 2nd locale is an option, but then I do not have to option of including the 'locale' part in the URL anymore.

tractorcow

I've started working on a locale menu for fluent. This should hopefully make it easier working on multiple locales on a single item. https://github.com/tractorcow-farm/silverstripe-fluent/pull/562

Show 1 attachment(s)
GitHub  
WIP Initial commit of new localisation menu by tractorcow · Pull Request #562 · tractorcow-farm/silverstripe-fluent

Just getting the look and feel right Not sure how to fit descriptions in. Maybe tooltips that show on hover? If I get silverstripe/silverstripe-framework#9305 merged I might work on adding JS tool...

Hide attachment content
👍 (4)
wmk

@tractorcow good to see! Thanks for improving fluent. I had a customer where I added fluent to an existing site and I thought it's not always clear for him if he's in the main language or in the translation.

tractorcow

Maybe we need to show the failovers "you are viewing the page in <locale> This page fails over from <locale1> if not localised This page fails over to <locale2, locale3> if they are not localised"

tractorcow

I'm thinking of pulling some of the advanced features into a separate tab; It might be easier to see a table that displays the status of the current record in each locale, along with some kind of batch action system

(2) (1)
taoceanz

It's not possible to translate SiteTree ParentID is it? Have just run into an issue of 2 pages using Translatable to be linked while in different Locale but, they have different parent pages. My guess is an Admin user created the translation page then dragged that translated page under a different parent page.

taoceanz

Looks like the pages that sit under a different parent page have been moved accidentally by someone so should just need to restore pages to the correct parent pages before running task to migrate from translatable to fluent.

nightjarnz

Fluent doesn't keep translations as separate pages, the ID should be the same for all translations for a page (and the the ParentID on any child).

nightjarnz

Translatable on the other hand was essentially subsites, but for languages.