Article Language and Search

When starting to use our Wiki, I still had default language settings configured, which meant that the Wiki defaulted to English.

Meanwhile I switched the language to German. It’s no multilingual Wiki, only German content.

Now I just noticed that Search is basically “not working” for all pages created until I switched the language, as those older pages are (wrongly) marked as “English language” and the Search by default only includes German language pages…

If I manually include English language pages in the search, the wrongly-tagged pages are found as desired.

Is there any way to fix the language meta data of that older pages (after finding https://forum.xwiki.org/t/how-do-i-change-or-set-a-language-on-a-page/2834 I fear there isn’t yet :-/ ) or to configure the Search to include all languages by default?

I just noticed the language selector in CKEditor - could it help? Currently however, it only offers

  • Arabic
  • French
  • Spanish

None of these languages is configured in Xwiki administration page however (the default was English and I just added German and made it default). Where does this language list come from, and how can I change it to include German and English?

Is you don’t have that many pages then you can:

Otherwise you need a script. I don’t know is there is such a script. One place to look for is https://snippets.xwiki.org .

Edit Main.SolrSearchConfig, look for facetQuery and remove the line that sets the locale filter.

That is used to mark a paragraph from your page as being written in a different language than the page itself (your page is in German and you insert a quote that is in French). The list of languages that appear on this drop down can be configured from the WYSIWYG editor administration section.

1 Like

Thanks a lot. The Wiki still has sufficiently few pages so manually updating the default language it was feasible and the simplest solution.

After redindexing, the search works much better now, so I do not need to adjust the Solr query.

Concerning the language drop down in CKEditor, I was not able to successfully locate the config option:

http://extensions.xwiki.org/xwiki/bin/view/Extension/CKEditor%20Integration/#HAdministrationSection

Or do I have to configure it using the “Advanced Configuration” text field? I searched the CKEditor extension page and Xwiki Internationalisation pages for hint, but without success. Where does the default list of “Arabic, French, Spanish” come from? Is it just CKEditor’s default - but as a default that’s an somewhat uncommon language selection. :slight_smile:

Yes, you need to use the “Advanced Configuration” text area. CKEditor and its plugins have a huge number of configuration options so we can’t expose all of them in the administration section. See https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-language_list

Defaults to [ 'ar:Arabic:rtl', 'fr:French', 'es:Spanish' ]

That is just the default from CKEditor. We didn’t overwrite it.

1 Like