Translate-plugin: Does not load language specific snippets when changing language

Created on 1 Sep 2016  路  9Comments  路  Source: rainlab/translate-plugin

I've created two different form partials and made them available as snippets and would like to load them according to the language. One partial contains an english form and one a different german form.

At the static page editor textbox I included the english snippet at EN then switched with the rop right icon to DE and included the german snippet.

If i now save the page and preview it, it will only show the partial from the language which is first loaded.

To make it more clear:

  1. [BACKEND] Save Page
  2. Open english page (english snippet shows - first load )
  3. Switch language to DE (german snippet do not show)
  4. [BACKEND] Save Page again
  5. Reload german page (german snippet shows - first load)
  6. Switch to EN (english snippet do not show)

Additional note:
Because of #153 I tried it with editing the files with an text editor only but this had no effect and resulted in only showing the first loaded language snippet.

Other pages using the same partial snippet for both languages seems not to be affected. Translations are shown correctly when used with translation placeholder {{ 'Welcome to our website!'|_ }}

Critical Completed Bug

All 9 comments

TL;DR. As per the contribution guidelines, please provide the exact steps you are taking for the issue to occur. This will be used for peer review.

Edge Updates are enabled.
I'm running October with
Core: 364
Pages: 1.2.10
Sitemap: 1.0.6
Translate: 1.2.4 (forceURL = 0)

Steps to reproduce this issue.

  1. Create 2 partials and make them available as snippets (1x test-de, 1x test-en)
  2. Create statig page with translated URL (loadsnippet-en, loadsnippet-de) and include "test-en" snippet at english content section and "test-de" snippet at german content section
  3. Preview site -> test-en snippet shows
  4. Switch to secondary german language -> test-de snippet does not show.
  5. Delete file cache
  6. Reload secondary german language -> test-de snippet show
  7. Switch to default language -> test-en snippet does not show

As you can see only the first rendered snippet after creation, / deleting file cache shows.

I'm switching languages with

<a class="item" data-request-data="locale: 'de'" data-request="onSwitchLocale" href="#"> Deutsch </a> 

and

<a class="item" data-request-data="locale: 'en'" data-request="onSwitchLocale" href="#"> English   </a>

+1

+1

+1

+1

+1

+1

Fixed in RainLab.Pages v1.2.12+ using October Build 381+

Was this page helpful?
0 / 5 - 0 ratings