Help on DeepL Integration extension

Hi,

according to the extension page, I installed the extension, inserted my DeepL API key into the xwiki.properties and restarted the XWiki.

The DeepLUsage shows “0 characters used”.

Now, I really don’t have any idea how to use it and the explanations on that extension page are not extremely exhaustive. There is a usage example on the page DeepLTranslationMacro which shows the expected link (translate into…) but clicking it just leads to the page itself, with no translation. Also the DeepL usage counter remains at zero characters so it appears nothing is happening.

I’m also trying to find the deeplTranslation macro itself to have a look into the code (it’s categorized as XAR so the UI should display the code in Velocity or Groovy if I’m not mistaken) but can’t find it. Is the source code for the macro available online somewhere?

Can the problem be that I’m running this on localhost? Version is 13.10.

Any help very appreciated.

Hi @Lukas,

I looked at the issue you mentioned, and I did find two issues that prevented the DeepL extension to work on first try on XWiki 13.10 (or, actually, on any version of XWiki). These were probably silly mistakes that were done because the extension was developed on an XWiki instance with other customization which actually helped to make the extension work properly on the dev instance.

The two issues are the following :

I just released a new version of the DeepL macro (version 1.2) which fixes these issues. The translation messages should now “work” properly when they get displayed on the page.

One note when testing out the extension : in order for it to work properly, you will need to update the preferences of your XWiki instance to change the following parameters :

  • Enable multilingual mode
  • Add multiple supported languages

These settings are important because the DeepL macro will use them in order to define if a page should be translated or not (and if so, the macro will display the translation link). I’ll update the documentation of the extension in order to clarify that multilingual mode should be enabled. In the meantime, you can check out the https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/I18N documentation of XWiki that explains a bit how internationalization works.

Thanks,
Clément

Thanks a lot! It appears the extension page itself (https://extensions.xwiki.org/xwiki/bin/view/Extension/DeepL/) was not updated, and using the extension manager also only gives me the old v1.1. So I dowloaded the two updated scripts directly from GitHub and manually updated the XWiki pages. Is this the way I’m supposed to use the extension for the moment?

When I do this and access the page with a browser in German language, the translation link on page DeepLTranslationMacro does NOT appear. Is this the expected behaviour?

My language settings:

Thanks a lot! It appears the extension page itself (DeepL Application (XWiki.org)) was not updated, and using the extension manager also only gives me the old v1.1. So I dowloaded the two updated scripts directly from GitHub and manually updated the XWiki pages. Is this the way I’m supposed to use the extension for the moment?

I triggered a manual update of the extension page, you should be able to see the v1.2 in the extension manager now. Just upgrade the extension, and select “use the last version of the page” if it throws any conflict.

When I do this and access the page with a browser in German language, the translation link on page DeepLTranslationMacro does NOT appear. Is this the expected behaviour?

Yes it’s normal. Here is what happens :

The page DeepLTranslationMacro is an extension page, so its default language and language are both set to be empty here.

Now, when the DeepL Translation macro encounters a document which has no language set (as it’s the case for this page), then it will consider that the language of the document is the default language of the wiki. In your case, it should be German, per your wiki preferences. Unfortunately, with the way things work in XWiki today, we can’t do much better : macro cannot “guess” the language in which a page has been written.

If you access the page with the interface in Dutsch (you should be able to add ?language=nl in your URL to force Dutsch I think), you should see the translation link.

Thanks,
Clément

Thanks, it works now - but only after I set the default language to English, which seems to have been my mistake (see screenshot above). Then, if I access the page with a German-speaking browser or add ?language=de, it will give me the translation link and then the translation.