*

149health

  • ***
  • 51 posts
Autotranslate Deepl plugin
« on: December 14, 2025, 07:44:47 PM »
DeepL plugin. Can it be possible to add a function to the plugin so that, if the site is multilingual, for example: eng><ru, then when you add an new item, it automatically translates to the second language? In fact, only the item title and description need to be translated, and that’s all.  8)

*

MB Themes

Re: Autotranslate Deepl plugin
« Reply #1 on: December 15, 2025, 02:35:29 PM »
Problem would be compatibility between source and target language.
Besides that it should be possible to use translation function like that.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

149health

  • ***
  • 51 posts
Re: Autotranslate Deepl plugin
« Reply #2 on: December 17, 2025, 12:28:48 AM »
Problem would be compatibility between source and target language.
Besides that it should be possible to use translation function like that.
What if we try to do it via a cron job? The plugin automatically detects the default language and translates the already filled-in listing data into the target language.

*

MB Themes

Re: Autotranslate Deepl plugin
« Reply #3 on: December 17, 2025, 08:13:45 AM »
That's possible too, but my concern is more about if text is ie in Romanian and you want to translate into Arabic, that may not be supported by DeepL. Plugin only cares about target language, as it expect source to be always english.

Anyway, you can give it a try.
Code: [Select]
 
  require_once osc_plugins_path() . osc_plugin_folder(__FILE__) . 'src/deepl/vendor/autoload.php';

  $text = 'abcd';
  $target_lang_code = 'de';
  $source_lang_code = 'sk';
  $translator = new DeepL\Translator(trd_param('api_key'));

  $options = array(
    'tag_handling' => 'html',             // html, xml
    'formality' => 'prefer_less',   
    // 'split_sentences' => 'nonewlines',    // off, on, nonewlines
    'max_retries' => 1,                   // default 5
    'timeout' => 3,                       // default 10
    'enable_beta_languages' => 1
  );

  $result = $translator->translateText($text, $source_lang_code, $target_lang_code, $options);

  echo ($result->text ?? '');
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

149health

  • ***
  • 51 posts
Re: Autotranslate Deepl plugin
« Reply #4 on: December 25, 2025, 01:05:56 PM »
My GIFT for You
* Universal DeepL Auto-Translate Cron for Osclass
 *
 * Features:
 * 1. Automatically detects the source language (most complete translation)
 * 2. Translates into ALL enabled site locales
 * 3. Fills only missing / empty translations
 * 4. Never overwrites existing content (only fills gaps)
 *
 * Run:
 * http://your-site/autotranslate_cron.php?key=YOUR_SECRET_KEY

*

MB Themes

Re: Autotranslate Deepl plugin
« Reply #5 on: December 29, 2025, 10:08:48 AM »
Thanks for sharing  ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

149health

  • ***
  • 51 posts
Re: Autotranslate Deepl plugin
« Reply #6 on: December 29, 2025, 12:28:13 PM »
Your welcome:)

*

149health

  • ***
  • 51 posts
Re: Autotranslate Deepl plugin
« Reply #7 on: January 06, 2026, 10:31:56 PM »
Guys, if you later decide to sell my solution… could you share the “Osclass Pay + Stripe plugin” with me? You’ll be making money from this cron file anyway.

*

MB Themes

Re: Autotranslate Deepl plugin
« Reply #8 on: January 07, 2026, 05:04:50 PM »
That plugin is free  :'( :-\
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots