From d5b3d9104db7a6a805b1b31dfbd1b15bb4ad161c Mon Sep 17 00:00:00 2001 From: ilja Date: Sat, 17 Dec 2022 13:22:23 +0100 Subject: [PATCH] Code review * Add Changelog and description.exs * Also cleaned up some code that was left behind when still poking at things a bit --- CHANGELOG.md | 1 + config/description.exs | 25 +++++++++++++++++++ .../akkoma/translators/argos_translate.ex | 1 - 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dcbc4b14..efcfc6727 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - Prometheus metrics exporting from `/api/v1/akkoma/metrics` - Ability to alter http pool size +- Translation of statuses via ArgosTranslate ### Removed - Non-finch HTTP adapters diff --git a/config/description.exs b/config/description.exs index eb61c7218..d7cce0ca1 100644 --- a/config/description.exs +++ b/config/description.exs @@ -3443,5 +3443,30 @@ config :pleroma, :config_description, [ suggestion: [nil] } ] + }, + %{ + group: :pleroma, + key: :argos_translate, + type: :group, + description: "ArgosTranslate Settings.", + children: [ + %{ + key: :command_argos_translate, + type: :string, + description: "command for `argos-translate`. Can be the command if it's in your PATH, or the full path to the file.", + suggestion: ["argos-translate"] + }, + %{ + key: :command_argospm, + type: :string, + description: "command for `argospm`. Can be the command if it's in your PATH, or the full path to the file.", + suggestion: ["argospm"] + }, + %{ + key: :strip_html, + type: :boolean, + description: "Strip html from the post before translating it." + } + ] } ] diff --git a/lib/pleroma/akkoma/translators/argos_translate.ex b/lib/pleroma/akkoma/translators/argos_translate.ex index 9e19b14c7..dfec81d0a 100644 --- a/lib/pleroma/akkoma/translators/argos_translate.ex +++ b/lib/pleroma/akkoma/translators/argos_translate.ex @@ -31,7 +31,6 @@ defmodule Pleroma.Akkoma.Translators.ArgosTranslate do |> String.split("\n", trim: true) |> Enum.map(fn "translate-" <> l -> String.split(l, "_") - _ -> "" end) source_langs =