kirby-tools / kirby-content-translator

🌐 Translate any page in the Panel or programmatically with DeepL
https://kirby.tools/content-translator
Other
9 stars 0 forks source link

Title and slug not translated #2

Closed foxacid closed 3 months ago

foxacid commented 4 months ago

I have 2.1.11 running and both panel button and CLI work great. However, slug and title are not translated despite global whitelisting. This is my config file:

  'johannschopplich.content-translator' => [
    'DeepL' => [
        'apiKey' => 'xxx'
    ],
    'title' => true,
    'slug' => true
  ],

Any ideas?

foxacid commented 4 months ago

I got the titles to work via CLI using translateTitle() (I had been missing the 3rd argument) but not in the panel...

johannschopplich commented 3 months ago

Hi there!

title and slug have to be explicitly enabled on a blueprint-basis, since there seems to be a bug at the moment:

type: content-translator
title: true
slug: true

Correct, for programmatic usage, you have to use the translateTitle method. However, there is no slug translation method as of right now. This is a todo.

johannschopplich commented 3 months ago

Thanks for reporting this! There was actually a bug in the code that caused global configuration overrides to never take effect. This has been fixed in the latest version. Sorry for the late response, I must have missed the notification.

Regarding the slug translation for PHP usage, I've created a separate issue #3.