Fixing some spelling and grammar issues that where noted in Dries notes. Also removing redundant warning message about incomplete AI settings on the "User interface translation" form (/admin/config/regional/translate).

With current module when you do not set the default provider + model you get an error message and a warning message about the same thing. I am removing the warning message from ai_translate.module as the function call _ai_translate_check_default_provider_and_model() already provides an error message with the same message.

Before:

  if (!_ai_translate_check_default_provider_and_model()) {
    $message = t('Please select a default provider and model for translation via the <a href="@ai_settings">AI settings</a> page.', [
      '@ai_settings' => Url::fromRoute('ai.settings_form')->toString(),
    ]);
    \Drupal::messenger()->addWarning($message);
  }

Duplicate messages

After:

  if (!_ai_translate_check_default_provider_and_model()) {
    return;
  }

Fix Duplicate messages

Issue fork ai-3557038

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

erichomanchuk created an issue. See original summary.

erichomanchuk’s picture

Status: Active » Needs review
vinodhini.e’s picture

Hi, Tested on Drupal 11.2.3

Steps followed:

Installed the AI Translate module.

Navigated to /admin/config/regional/translate without setting a default provider and model.

Encountered the issue — the same message was displayed twice:

Once as an error, and Once as a warning.

After applying MR #1007:

The issue was resolved. Now only a single error message is displayed.

The message also includes correct spelling and grammar. Thanks.

svendecabooter’s picture

Project: AI (Artificial Intelligence) » AI translate
Component: AI Translate » Code
Assigned: erichomanchuk » Unassigned

svendecabooter changed the visibility of the branch 3557038-spelling-and-grammar to hidden.

svendecabooter’s picture

Status: Needs review » Reviewed & tested by the community

Created a new MR in the ai_translate module, instead of the AI module.
Added the commit by erichomanchuk to that MR.

Changes look good to me.

svendecabooter’s picture

Version: 2.0.x-dev » 1.3.x-dev
valthebald’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • 199b73a7 committed on 1.3.x
    fix: #3557038 Spelling and grammar fixes for AI Translate
    
    By:...

  • f6f2a087 committed on 2.0.x
    fix: #3557038 Spelling and grammar fixes for AI Translate
    
    By:...
valthebald’s picture

Committed to 1.3.x and 2.0.x, thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.