AWM Filter livetable title per language

Hi. I’m maintaining a multi-language XWiki.
As I try to create a FAQ with the AppWithinMinutes extension, I came to notice a little problem with the functionality of the live table filter.
I try to filter by the page title. In the original language it works fine and shows the correct results. But in the translated version, it seems that the filter will not use the translated titles.

An example for better understanding.

  • Live table space: FAQ
    ** Original document language: EN
    ** Translation: DE

  • An entry with the page reference: Can-I-delete-chats.WebHome
    ** Original document language: EN / Original title: Can I delete chats
    ** Translation: DE / Translation title: Kann ich Chats löschen

Now it behaves like this:

  • In the EN version, I filter titles for “can”. The table will show “Can I delete chats”.
  • In the DE version, I filter titles for “kann”. The table won’t show any entries as result.
  • In the DE version, I filter titles for “can”. The table will show “Kann ich Chats löschen”.

This is the current live table (it’s the default from AWM). “Topic” is a checkbox attribute which should not matter here.

{{velocity}}
#set ($columnsProperties = {
  'doc.title': {"link":"view"},
  'Topic': {},
  '_actions': {"sortable":false,"filterable":false,"html":true,"actions":["edit","delete"]}
})
#set ($options = {
  'className': 'Public.FAQ.Code.FAQClass',
  'translationPrefix': 'faq.livetable.',
  'tagCloud': true,
  'rowCount': 15,
  'maxPages': 10,
  'selectedColumn': 'doc.title',
  'defaultOrder': 'asc'
})
#set ($columns = ['doc.title', 'Topic', '_actions'])
#livetable('faq' $columns $columnsProperties $options)
{{/velocity}}

Can you help me out? Or can you confirm that multi-language is not working with the live table filter? Any workarounds or best practices?

Thank you in advance for your help.

Multi-language has quite some rough edges, it’s quite possibly that you’ve just discovered another one. Feel free to report a bug.

Hi,

The metadata (objects) attached to a wiki page is shared by all its translations, but it’s stored on the default translation. In your example, the FAQ object is stored on the default English translation, “Can I delete chats”. The German translation, “Kann ich Chats löschen”, doesn’t have itself an FAQ object, but it shares the FAQ object from the English translation.

The live table you have, as you can see from its configuration, is listing pages with:

i.e. pages that have an FAQ object. These pages are retrieved with a database query. But since the objects are stored on the default page translation, the database query targets only default page translations. Once the pages are retrieved from the database, their title is displayed. This part takes into account the current locale, so you can see the German page title displayed, but the underlying page that was retrieved from the database is in fact the Eglish default translation.

I guess we could modify the database query to “join” the page translations matching the current locale, and filter their title. It will certainly complicate the query, but it’s better for the end user. You should report an issue, if it’s not already reported.

Thanks,
Marius

Also related: Loading...

Thank you very much for the explanation. I opened an issue as recommended.
https://jira.xwiki.org/browse/XWIKI-23007