Translation not loading in extension configuration #6

Closed
opened 2025-07-01 00:56:16 -05:00 by tryallthethings · 1 comment

Hey! Might be related to #4. I just installed the extension v0.3 while testing something else and noticed that the translations are not loaded in the configuration dialog.

image

Adding $this->registerTranslates(); to extension.php fixes this.

public function handleConfigureAction() {
    $this->registerTranslates();

    if (Minz_Request::isPost()) {
      $kagi_token = Minz_Request::param('kagi_token', '');
      $prefix = 'https://kagi.com/search?token=';
      if (substr($kagi_token, 0, strlen($prefix)) == $prefix) {
        $kagi_token = substr($kagi_token, strlen($prefix));
      }
      FreshRSS_Context::$user_conf->kagi_token = $kagi_token;
      FreshRSS_Context::$user_conf->kagi_language = Minz_Request::param('kagi_language', '');
      FreshRSS_Context::$user_conf->kagi_custom_css = Minz_Request::param('kagi_custom_css', '');
      FreshRSS_Context::$user_conf->save();
    }
  }

image

Hey! Might be related to #4. I just installed the extension v0.3 while testing something else and noticed that the translations are not loaded in the configuration dialog. ![image](/attachments/14b44694-80cc-475f-a7a9-583b0763ce9d) Adding `$this->registerTranslates();` to extension.php fixes this. ```PHP public function handleConfigureAction() { $this->registerTranslates(); if (Minz_Request::isPost()) { $kagi_token = Minz_Request::param('kagi_token', ''); $prefix = 'https://kagi.com/search?token='; if (substr($kagi_token, 0, strlen($prefix)) == $prefix) { $kagi_token = substr($kagi_token, strlen($prefix)); } FreshRSS_Context::$user_conf->kagi_token = $kagi_token; FreshRSS_Context::$user_conf->kagi_language = Minz_Request::param('kagi_language', ''); FreshRSS_Context::$user_conf->kagi_custom_css = Minz_Request::param('kagi_custom_css', ''); FreshRSS_Context::$user_conf->save(); } } ``` ![image](/attachments/dcfcbd8c-447a-4bf6-be1c-da71f65355f5)
152 KiB
148 KiB
Owner

Thank you for that. Inspecting a few other extensions out there, I see putting that call in both the init and handleConfigureAction seems to be standard practice. I wonder why I don't experience this problem on my own installation.

Thank you for that. Inspecting a few other extensions out there, I see putting that call in both the `init` and `handleConfigureAction` seems to be standard practice. I wonder why I don't experience this problem on my own installation.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rudism/freshrss-kagi-summarizer#6
No description provided.