Add orca-translations Claude skill and PO tool (#16436)

* Add orca-translations Claude skill and PO tool

Add a .claude skill that guides translation passes over the localization/i18n gettext catalogs. It covers the workflow: run gettext, settle new glossary terms, translate in batches, verify, and report.

Includes translation-rules.md, which condenses the placeholder, line-break and glossary rules plus the guidance on review notes.

Also adds scripts/po_tool.py (standard library only). It lists pending entries with glossary hints, validates and applies translations, adding '# AI Translated' and '# Needs human review' comments, and rewrites only the entries it changes. It can also check catalogs, look up existing translations, suggest glossary candidates and update the wiki glossary TSV.

* Let po_tool apply translations by entry id

pending now gives each entry a short id, so a translation file can name
entries by id instead of repeating the English msgid. apply accepts either.

A "review": "" item clears an earlier review note when overwriting an
entry, and check gives each msgfmt run its own temporary output file so
parallel checks do not collide.

* Fill all empty translations

Regenerate the template with run_gettext --full and translate every empty
entry in the 22 catalogs (7,089 entries) with the orca-translations skill,
following the localization glossary, including the new belt printer,
IDEX/IQEX and plugin terms. Every new entry is marked "# AI Translated";
122 also carry "# Needs human review" with what to check.

* Show entry ids in po_tool lookup and search translations

lookup now prints each entry's id, so an entry found there can be
rewritten with apply --overwrite without repeating the English, and
--msgstr searches the translations instead of the msgids, which finds
every entry that still uses a term being changed.

SKILL.md describes how to change an established term: check the
catalog's usage first, update the glossary cell, then rewrite only the
entries where the term has that meaning.

* Fix mistranslated terms and align catalogs with the glossary

Correct labels that the glossary had copied, and the entries that used
them:
- ca: Raft was rendered as the Brim term; it is now "Rai". Exhaust fan,
  Monotonic line, Unretract, Slice, Lateral Honeycomb and PA Tower
  labels fixed.
- cs: Lightning infill is "Blesk", not "Osvětlení" (illumination).
- sv: Retraction is "Retraktion", not "Reduktion"; Unretract,
  Lagerhöjd, Delkylningsfläkt, Utsugsfläkt, Aligned Rectilinear and the
  Preset label fixed.
- de: Brim is "Rand" and Skirt is "Umrandung", as most entries already
  had them.
- lt: brim entries used the Skirt word "apvadas"; they now use "kraštas".
- es: Sparse infill is "relleno de baja densidad", the catalog majority.
- eu: nozzle wipe is "garbiketa", not purge.
- th: the project plate is "เพลต", distinct from the bed.
- uk: Quarter Cubic, Latin "PA" in PA Tower, and Belt purge tower.
- pl: Cross Hatch, Tri-hexagon, Volumetric speed and Raft labels.
- zh_TW: Brim stays "Brim", as the existing labels have it.
- tr: "Prime Tower" read "Prime Minister Tower".
- ko: the plugin "Capabilities" label read "performance".
- Build Volume labels fixed in tr, de, cs and eu.

All 242 rewritten entries are marked "# AI Translated".

* Make more UI text translatable and fix pluralization and context

Audit the sources for text that translators could not translate
correctly and fix it.

Mark text that reached users in English only: IDEX/IQEX role names,
plugin permission prompts and errors, 3MF/preset loading errors, G-code
placeholder parser errors, calibration and device messages, notification
texts, file dialog filters, and the config validation messages.

Replace sentences built from translated fragments, such as the prime
tower warnings, "left"/"right" nozzle names, and "Filament " + number,
with single msgids that have placeholders, so translators can reorder
and inflect them.

Use plural forms for texts with a count ("%1% mixed filaments",
"%d objects", "%1% triangles") instead of "(s)" and mismatched verbs.
Fix the swapped singular/plural pair in "The following presets inherit
this preset".

Add translation contexts where one English word has several meanings
(Subscribed/Local, Standard, Pause, View, Step, Model, Camera, Flow,
Filter, Others, Prepare, the Design tools). Show "Size" instead of
"Build Volume" in the Cut tool, which displays the object size.

Fix code that compared translated text with English (the Edit G-code
dialog group, the plugin registration failure check), and add the
bundled web pages' missing string-table entries. Use the single
character for degrees Celsius, say "G-code", and describe the head
filament map without internal jargon.

Install the libslic3r translate callback before the presets load, so
their load errors are translated, and list the 28 source files that had
marked strings but were never extracted into localization/i18n/list.txt.

* Suggest earlier translations and list fuzzy entries in po_tool pending

pending now attaches the closest earlier translation of a similar
English text (from obsolete or translated entries), so a reworded or
split string keeps its wording, and it lists fuzzy entries by default,
since users never see them. A fuzzy entry also carries its stale
translation as previous_translation.

* Fix wording of the non-boolean operands error

The logical operation error said "operators" where it means the
operands the operation was applied to.

* Translate the newly translatable strings in all languages

Regenerate the template after the translatability changes and fill every
new or changed entry in the 22 catalogs (about 12,800 entries): the
strings that became translatable, the plural forms, the entries split by
context, and the previously fuzzy singular entries that became plurals.

Every new entry is marked "# AI Translated", and about 360 also carry a
"# Needs human review" note saying what to check. Terms follow the
localization glossary. Earlier translations of reworded strings were
reused where the meaning was unchanged. Existing entries were not
changed, and obsolete entries are kept.

* Document the source translatability audit in the orca-translations skill

Add a reference describing how strings reach translators, what to look
for (untranslated text, spliced sentences, missing plurals, ambiguous
words), what not to translate, where a context cannot be carried, and
what to do after the edits, plus a scanner that lists untranslated
user-facing string literals.

* Document how to write translatable strings in AGENTS.md

Tell developers to keep each message complete in one msgid: use
placeholders instead of concatenating translated fragments, plural forms
for counts, and contexts for ambiguous words, and to list new source
files in localization/i18n/list.txt. Add a matching code review item.

* Translate the strings added since the rebase

Regenerate the template against the current main and translate the 26
new entries per language: the Fix Model commands and messages, and the
texture displacement image adjustment panel. Each new entry is marked
"# AI Translated"; existing entries are unchanged.

* tidy
This commit is contained in:
Ian Bassi
2026-10-13 10:53:57 -03:00
committed by GitHub
parent b77b5afd49
commit e821665e4b
154 changed files with 98207 additions and 17434 deletions
+23 -20
View File
@@ -1,6 +1,8 @@
#include "CloudPluginService.hpp"
#include "OrcaCloudServiceAgent.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/format.hpp"
#include "slic3r/Utils/Http.hpp"
#include <boost/filesystem.hpp>
@@ -77,12 +79,12 @@ bool CloudPluginService::request_cloud_subscribe(const std::string& plugin_uuid,
return false;
}
if (plugin_uuid.empty()) {
error = "Cloud plugin key is missing UUID.";
error = _u8L("Cloud plugin key is missing UUID.");
return false;
}
if (m_orca_agent->subscribe_plugin(plugin_uuid) != 0) {
error = "Failed to subscribe to cloud plugin, see logs for more info.";
error = _u8L("Failed to subscribe to cloud plugin, see logs for more info.");
return false;
}
@@ -97,20 +99,20 @@ bool CloudPluginService::request_cloud_unsubscribe(const PluginDescriptor& plugi
}
if (!plugin.is_cloud_plugin()) {
error = "Only cloud plugins can be unsubscribed.";
error = _u8L("Only cloud plugins can be unsubscribed.");
return false;
}
const std::string cloud_uuid = plugin.cloud_uuid();
if (cloud_uuid.empty()) {
error = "Cloud plugin key is missing UUID.";
error = _u8L("Cloud plugin key is missing UUID.");
return false;
}
int result = m_orca_agent->unsubscribe_plugins({cloud_uuid});
if (result != 0) {
error = "Failed to unsubscribe plugin, see logs for more info.";
error = _u8L("Failed to unsubscribe plugin, see logs for more info.");
return false;
}
@@ -147,13 +149,14 @@ bool CloudPluginService::download_cloud_plugin(PluginDescriptor& entry,
int result = m_orca_agent->get_plugin_download_url(entry_uuid, requested_version, data, not_found, unauthorized);
if (result != 0) {
error = "Failed to fetch download_url, result =" + std::to_string(result);
// TRN %1% is the numeric result code returned by the cloud service.
error = GUI::format(_u8L("Failed to fetch the plugin download URL (result %1%)."), result);
return false;
}
for (const std::string& plugin_uuid : unauthorized) {
if (plugin_uuid == entry_uuid) {
error = "You are not authorized to download this cloud plugin.";
error = _u8L("You are not authorized to download this cloud plugin.");
return false;
}
}
@@ -161,16 +164,17 @@ bool CloudPluginService::download_cloud_plugin(PluginDescriptor& entry,
for (const PluginDownloadNotFound& item : not_found) {
if (item.id == entry_uuid) {
if (item.reason == "requested os not found")
error = "No plugin package is available for this operating system.";
error = _u8L("No plugin package is available for this operating system.");
else if (item.reason == "requested version not found")
error = requested_version.empty() ? "The selected plugin version was not found." :
"Plugin version " + requested_version + " was not found.";
error = requested_version.empty() ? _u8L("The selected plugin version was not found.") :
GUI::format(_u8L("Plugin version %1% was not found."), requested_version);
else if (item.reason == "requested plugin not found")
error = "Cloud plugin was not found.";
error = _u8L("Cloud plugin was not found.");
else if (!item.reason.empty())
error = "Cloud plugin download was not found: " + item.reason + ".";
// TRN %1% is the reason reported by the cloud service, in English.
error = GUI::format(_u8L("Cloud plugin download was not found: %1%."), item.reason);
else
error = "Cloud plugin download was not found.";
error = _u8L("Cloud plugin download was not found.");
return false;
}
}
@@ -183,8 +187,7 @@ bool CloudPluginService::download_cloud_plugin(PluginDescriptor& entry,
}
if (download_url.empty()) {
error = "No download URL is available for this plugin. Please "
"check the logs for errors.";
error = _u8L("No download URL is available for this plugin. Please check the logs for errors.");
return false;
}
@@ -210,17 +213,17 @@ bool CloudPluginService::download_cloud_plugin(PluginDescriptor& entry,
.perform_sync();
if (!error.empty()) {
error = "Failed to download plugin: " + error;
error = GUI::format(_u8L("Failed to download plugin: %1%"), error);
return false;
}
if (http_status >= 400) {
error = "Plugin download failed with HTTP status " + std::to_string(http_status);
error = GUI::format(_u8L("Plugin download failed with HTTP status %1%."), http_status);
return false;
}
if (body.empty()) {
error = "Plugin download returned empty data.";
error = _u8L("Plugin download returned empty data.");
return false;
}
@@ -232,12 +235,12 @@ bool CloudPluginService::download_cloud_plugin(PluginDescriptor& entry,
{
boost::nowide::ofstream file(tmp_path.string(), std::ios::binary | std::ios::trunc);
if (!file) {
error = "Failed to create temporary file for plugin download.";
error = _u8L("Failed to create temporary file for plugin download.");
return false;
}
file.write(body.data(), body.size());
if (!file) {
error = "Failed to write plugin data to temporary file.";
error = _u8L("Failed to write plugin data to temporary file.");
return false;
}
}
+22 -11
View File
@@ -12,6 +12,7 @@
#include <algorithm>
#include <cctype>
#include <cstddef>
#include <cstdlib>
#include <future>
#include <mutex>
@@ -501,9 +502,9 @@ bool PluginAuditManager::request_filesystem_read_permissions(const std::string&
wxMessageDialog dialog(
nullptr,
wxString::Format("Plugin \"%s\" requests filesystem read access to:\n%s",
wxString::Format(_L("Plugin \"%s\" requests filesystem read access to:\n%s"),
wxString::FromUTF8(descriptor.name.c_str()), requested_paths),
"Plugin permissions",
_L("Plugin permissions"),
wxYES_NO | wxICON_WARNING);
return dialog.ShowModal() == wxID_YES;
};
@@ -521,9 +522,9 @@ bool PluginAuditManager::request_filesystem_read_permissions(const std::string&
wxMessageDialog dialog(
nullptr,
wxString::Format("Plugin \"%s\" requests filesystem read access to:\n%s",
wxString::Format(_L("Plugin \"%s\" requests filesystem read access to:\n%s"),
wxString::FromUTF8(descriptor_name.c_str()), requested_paths),
"Plugin permissions",
_L("Plugin permissions"),
wxYES_NO | wxICON_WARNING);
result->set_value(dialog.ShowModal() == wxID_YES);
});
@@ -842,7 +843,7 @@ int report_denied(PluginAuditManager& mgr,
}
wxString audit_message(AuditEventCategory category, const wxString& plugin_name, const wxString& event_name,
const wxString& target_list)
const wxString& target_list, size_t target_count)
{
if (target_list.IsEmpty())
return wxString::Format(
@@ -852,19 +853,29 @@ wxString audit_message(AuditEventCategory category, const wxString& plugin_name,
switch (category) {
case AuditEventCategory::FsRead:
return wxString::Format(_L("Plugin \"%s\" is requesting to read the following file(s):\n%s"), plugin_name, target_list);
return wxString::Format(_L_PLURAL("Plugin \"%s\" is requesting to read the following file:\n%s",
"Plugin \"%s\" is requesting to read the following files:\n%s", target_count),
plugin_name, target_list);
case AuditEventCategory::FsReadWrite:
return wxString::Format(_L("Plugin \"%s\" is requesting to read/write the following file(s):\n%s"), plugin_name, target_list);
return wxString::Format(_L_PLURAL("Plugin \"%s\" is requesting to read/write the following file:\n%s",
"Plugin \"%s\" is requesting to read/write the following files:\n%s", target_count),
plugin_name, target_list);
case AuditEventCategory::FsCreate:
return wxString::Format(_L("Plugin \"%s\" is requesting to create the following file(s):\n%s"), plugin_name, target_list);
return wxString::Format(_L_PLURAL("Plugin \"%s\" is requesting to create the following file:\n%s",
"Plugin \"%s\" is requesting to create the following files:\n%s", target_count),
plugin_name, target_list);
case AuditEventCategory::FsDelete:
return wxString::Format(_L("Plugin \"%s\" is requesting to delete the following file(s):\n%s"), plugin_name, target_list);
return wxString::Format(_L_PLURAL("Plugin \"%s\" is requesting to delete the following file:\n%s",
"Plugin \"%s\" is requesting to delete the following files:\n%s", target_count),
plugin_name, target_list);
case AuditEventCategory::Http:
return wxString::Format(_L("Plugin \"%s\" is requesting to make an HTTP request to:\n%s"), plugin_name, target_list);
case AuditEventCategory::Socket:
return wxString::Format(_L("Plugin \"%s\" is requesting to open a network connection to:\n%s"), plugin_name, target_list);
case AuditEventCategory::ProcessCreate:
return wxString::Format(_L("Plugin \"%s\" is requesting to run the following command(s):\n%s"), plugin_name, target_list);
return wxString::Format(_L_PLURAL("Plugin \"%s\" is requesting to run the following command:\n%s",
"Plugin \"%s\" is requesting to run the following commands:\n%s", target_count),
plugin_name, target_list);
case AuditEventCategory::Threading:
return wxString::Format(_L("Plugin \"%s\" is requesting permission to create a thread."), plugin_name);
case AuditEventCategory::ProcessReplace:
@@ -884,7 +895,7 @@ bool prompt_for_targets(AuditEventCategory category, const std::string& plugin_n
wxMessageDialog dialog(nullptr,
audit_message(category, wxString::FromUTF8(plugin_name.c_str()),
wxString::FromUTF8(event_name.c_str()), target_list),
wxString::FromUTF8(event_name.c_str()), target_list, unresolved.size()),
_L("Plugin permission request"), wxYES_NO | wxICON_WARNING);
return dialog.ShowModal() == wxID_YES;
}
+4 -4
View File
@@ -337,11 +337,11 @@ bool parse_plugin_overrides(const std::string& raw, CapabilityConfigDocument& do
const nlohmann::json parsed = nlohmann::json::parse(raw, nullptr, /* allow_exceptions */ false);
if (parsed.is_discarded()) {
error = "The preset stores invalid plugin capability configuration JSON.";
error = _u8L("The preset stores invalid plugin capability configuration JSON.");
return false;
}
if (!parsed.is_array()) {
error = "The preset's plugin capability configuration is not an array and cannot be edited.";
error = _u8L("The preset's plugin capability configuration is not an array and cannot be edited.");
return false;
}
@@ -592,7 +592,7 @@ nlohmann::json PluginConfig::get_config_response(const PluginCapabilityId& id)
} catch (const std::exception& ex) {
error = ex.what();
} catch (...) {
error = "Unknown error";
error = _u8L("Unknown error");
}
}
@@ -688,7 +688,7 @@ nlohmann::json PluginConfig::restore_config_response(const PluginCapabilityId& i
} catch (const std::exception& ex) {
error = ex.what();
} catch (...) {
error = "Unknown error";
error = _u8L("Unknown error");
}
}
+15 -10
View File
@@ -13,6 +13,8 @@
#include "PluginAuditManager.hpp"
#include "PythonInterpreter.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/format.hpp"
#include <exception>
#include <miniz.h>
@@ -93,7 +95,7 @@ bool resolve_allowed_plugin_root(const PluginDescriptor& descriptor,
const fs::path plugin_root = resolve_plugin_root_from_descriptor(descriptor);
if (plugin_root.empty()) {
error = "Plugin folder could not be determined.";
error = _u8L("Plugin folder could not be determined.");
return false;
}
@@ -104,7 +106,7 @@ bool resolve_allowed_plugin_root(const PluginDescriptor& descriptor,
resolved_root = fs::absolute(plugin_root, ec);
}
if (ec || resolved_root.empty()) {
error = "Failed to resolve plugin folder: " + plugin_root.string();
error = GUI::format(_u8L("Failed to resolve plugin folder: %1%"), plugin_root.string());
return false;
}
@@ -123,7 +125,8 @@ bool delete_plugin_root(const boost::filesystem::path& resolved_root, const std:
boost::system::error_code ec;
const auto removed_count = fs::remove_all(resolved_root, ec);
if (ec) {
error = "Failed to delete plugin folder " + resolved_root.string() + ": " + ec.message();
// TRN %1% is a folder path, %2% the system error message.
error = GUI::format(_u8L("Failed to delete plugin folder %1%: %2%"), resolved_root.string(), ec.message());
return false;
}
@@ -1204,7 +1207,7 @@ boost::filesystem::path find_installed_plugin_entry(const boost::filesystem::pat
namespace fs = boost::filesystem;
if (!fs::exists(plugin_dir) || !fs::is_directory(plugin_dir)) {
error = "Plugin directory does not exist: " + plugin_dir.string();
error = GUI::format(_u8L("Plugin directory does not exist: %1%"), plugin_dir.string());
return {};
}
@@ -1220,15 +1223,17 @@ boost::filesystem::path find_installed_plugin_entry(const boost::filesystem::pat
const fs::path ext = it->path().extension();
if (ext == ".py") {
if (!py_entry.empty()) {
error = "Plugin directory contains multiple .py files: " + py_entry.filename().string() +
" and " + it->path().filename().string();
// TRN %1% and %2% are file names.
error = GUI::format(_u8L("Plugin directory contains multiple .py files: %1% and %2%"),
py_entry.filename().string(), it->path().filename().string());
return {};
}
py_entry = it->path();
} else if (ext == ".whl") {
if (!whl_entry.empty()) {
error = "Plugin directory contains multiple .whl files: " + whl_entry.filename().string() +
" and " + it->path().filename().string();
// TRN %1% and %2% are file names.
error = GUI::format(_u8L("Plugin directory contains multiple .whl files: %1% and %2%"),
whl_entry.filename().string(), it->path().filename().string());
return {};
}
whl_entry = it->path();
@@ -1236,7 +1241,7 @@ boost::filesystem::path find_installed_plugin_entry(const boost::filesystem::pat
}
if (!py_entry.empty() && !whl_entry.empty()) {
error = "Plugin directory contains both .py and .whl entry files";
error = _u8L("Plugin directory contains both .py and .whl entry files");
return {};
}
@@ -1246,7 +1251,7 @@ boost::filesystem::path find_installed_plugin_entry(const boost::filesystem::pat
if (!whl_entry.empty())
return whl_entry;
error = "Plugin directory does not contain a .py or .whl entry file";
error = _u8L("Plugin directory does not contain a .py or .whl entry file");
return {};
}
+6 -4
View File
@@ -10,6 +10,8 @@
#include "libslic3r/LifecycleEvents.hpp"
#include "libslic3r/Print.hpp"
#include "libslic3r_version.h"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/format.hpp"
#include <boost/log/trivial.hpp>
@@ -106,12 +108,12 @@ void install_slicing_pipeline_hook()
} catch (const std::exception& ex) {
// A Python raise reaches here as pybind11::error_already_set; surface it as a
// (non-critical) slicing error instead of a crash.
throw SlicingError(std::string("Slicing pipeline plugin '") +
ref.capability_name + "' error: " + ex.what());
throw SlicingError(GUI::format(_u8L("Slicing pipeline plugin '%1%' error: %2%"),
ref.capability_name, ex.what()));
}
if (r.status == PluginResult::FatalError)
throw SlicingError(std::string("Slicing pipeline plugin '") +
ref.capability_name + "' error: " + r.message);
throw SlicingError(GUI::format(_u8L("Slicing pipeline plugin '%1%' error: %2%"),
ref.capability_name, r.message));
// log a non-empty success/skipped message instead of dropping it. This is
// log-only by design: every pipeline hook fires AFTER set_done() (see Print.cpp),
// so the Print-level m_step_active is -1 here. Calling active_step_add_warning()
+39 -25
View File
@@ -5,10 +5,13 @@
// service header stays free of the manager.
#include "PluginManager.hpp"
#include "PluginConfig.hpp"
#include "PluginFsUtils.hpp"
#include "PythonInterpreter.hpp"
#include "PythonPluginBridge.hpp"
#include "libslic3r/Utils.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/format.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/case_conv.hpp>
@@ -98,7 +101,7 @@ bool read_local_plugin_package_metadata(const boost::filesystem::path& source_pa
const std::string ext = plugin_package_extension(source_path);
if (ext != ".py" && ext != ".whl") {
error = "Plugin package must be a .py or .whl file, got: " + ext;
error = GUI::format(_u8L("Plugin package must be a .py or .whl file, got: %1%"), ext);
return false;
}
@@ -174,14 +177,15 @@ bool add_wheel_dependencies_to_sys_path(const PluginDescriptor& descriptor,
if (!fs::exists(dep_dir)) {
std::string extract_error;
if (!extract_zip_to_directory(it->path(), dep_dir, extract_error)) {
error = "Failed to extract plugin .whl dependency " + it->path().string() + ": " + extract_error;
// TRN %1% is the dependency file, %2% the error detail.
error = GUI::format(_u8L("Failed to extract plugin .whl dependency %1%: %2%"), it->path().string(), extract_error);
return false;
}
}
std::string syspath_error;
if (!interpreter.add_plugin_sys_path(dep_dir.string(), syspath_error)) {
error = "Failed to add .whl dependency to sys.path: " + syspath_error;
error = GUI::format(_u8L("Failed to add .whl dependency to sys.path: %1%"), syspath_error);
return false;
}
plugin_paths.push_back(dep_dir.string());
@@ -230,22 +234,25 @@ bool load(const PluginDescriptor& descriptor,
const std::vector<std::string>& capabilities_to_enable,
const std::function<std::string(const Plugin&)>& registry_precheck,
Plugin& out,
std::string& error)
std::string& error,
bool* registration_failed)
{
error.clear();
out = Plugin{};
if (registration_failed != nullptr)
*registration_failed = false;
BOOST_LOG_TRIVIAL(info) << "[plugin_loader::load] START plugin=" << descriptor.plugin_key
<< " thread=" << std::this_thread::get_id();
PythonInterpreter& interpreter = PythonInterpreter::instance();
if (!interpreter.is_initialized()) {
error = "Python interpreter not initialized: " + interpreter.last_error();
error = GUI::format(_u8L("Python interpreter not initialized: %1%"), interpreter.last_error());
return false;
}
if (!descriptor.is_metadata_valid()) {
error = "Plugin manifest is invalid: " + descriptor.plugin_key;
error = GUI::format(_u8L("Plugin manifest is invalid: %1%"), descriptor.plugin_key);
if (descriptor.has_error())
error += " - " + descriptor.normalized_error();
return false;
@@ -266,7 +273,7 @@ bool load(const PluginDescriptor& descriptor,
if (!skip_deps) {
std::string pkg_install_error;
if (!install_packages(descriptor.dependencies, pkg_install_error)) {
error = "Failed to install plugin dependencies: " + pkg_install_error;
error = GUI::format(_u8L("Failed to install plugin dependencies: %1%"), pkg_install_error);
return false;
}
}
@@ -285,7 +292,7 @@ bool load(const PluginDescriptor& descriptor,
PyObject* module = import_plugin_module(descriptor, plugin.plugin_sys_paths, plugin.plugin_modules, load_error);
if (module == nullptr) {
bridge.cancel_plugin_capture(descriptor.entry_path);
error = "Failed to load plugin module: " + load_error;
error = GUI::format(_u8L("Failed to load plugin module: %1%"), load_error);
return false;
}
@@ -300,11 +307,13 @@ bool load(const PluginDescriptor& descriptor,
auto capabilities_found = bridge.finalize_plugin_capture(descriptor.entry_path, descriptor.plugin_key, bridge_error);
if (!bridge_error.empty()) {
capabilities_found.clear();
error = "Plugin registration failed: " + bridge_error;
error = GUI::format(_u8L("Plugin registration failed: %1%"), bridge_error);
if (registration_failed != nullptr)
*registration_failed = true;
return false;
}
if (capabilities_found.empty()) {
error = "Plugin module did not register any capabilities";
error = _u8L("Plugin module did not register any capabilities");
return false;
}
@@ -355,8 +364,9 @@ bool load(const PluginDescriptor& descriptor,
}
if (!seen_capabilities[type].insert(found.name).second) {
materialization_error = "Plugin declares duplicate capability '" + found.name + "' for type " +
plugin_capability_type_to_string(type);
// TRN %1% is the capability name, %2% the capability type (e.g. Script).
materialization_error = GUI::format(_u8L("Plugin declares duplicate capability '%1%' for type %2%"),
found.name, PluginConfig::capability_type_label(type));
break;
}
@@ -380,9 +390,9 @@ bool load(const PluginDescriptor& descriptor,
capabilities.push_back(std::move(instance));
}
} catch (const std::exception& ex) {
materialization_error = std::string("Plugin capability materialization failed: ") + ex.what();
materialization_error = GUI::format(_u8L("Plugin capability materialization failed: %1%"), ex.what());
} catch (...) {
materialization_error = "Plugin capability materialization failed";
materialization_error = _u8L("Plugin capability materialization failed");
}
}
@@ -423,11 +433,12 @@ bool load(const PluginDescriptor& descriptor,
}
} catch (const std::exception& ex) {
teardown_capabilities(plugin.capabilities, lifecycle_count);
error = std::string("Plugin on_load failed: ") + ex.what();
// TRN on_load is the name of the plugin's startup function; keep it untranslated.
error = GUI::format(_u8L("Plugin on_load failed: %1%"), ex.what());
return false;
} catch (...) {
teardown_capabilities(plugin.capabilities, lifecycle_count);
error = "Plugin on_load failed";
error = _u8L("Plugin on_load failed");
return false;
}
@@ -608,7 +619,7 @@ bool install_plugin(const boost::filesystem::path& filepath,
bool backup_created = false;
auto fail = [&error](const std::string& message) {
error = "Plugin installation failed: " + message;
error = GUI::format(_u8L("Plugin installation failed: %1%"), message);
return false;
};
@@ -616,22 +627,23 @@ bool install_plugin(const boost::filesystem::path& filepath,
const fs::path source_path = canonical_or_absolute(filepath);
if (!fs::exists(source_path, ec) || !fs::is_regular_file(source_path, ec))
return fail("Plugin package is not a file: " + filepath.string());
return fail(GUI::format(_u8L("Plugin package is not a file: %1%"), filepath.string()));
const std::string ext = plugin_package_extension(source_path);
if (ext != ".py" && ext != ".whl")
return fail("Plugin package must be a .py or .whl file, got: " + ext);
return fail(GUI::format(_u8L("Plugin package must be a .py or .whl file, got: %1%"), ext));
// The cloud UUID is concatenated into the install path (final_dir = plugin_root / cloud_uuid).
// It comes verbatim from the server's catalog JSON, so reject anything that could escape the
// per-user plugin root (traversal, leading dots, separators) before touching the filesystem.
if (is_cloud_install && !is_valid_plugin_id(cloud_uuid))
return fail("Cloud plugin UUID is not a valid identifier: " + cloud_uuid);
return fail(GUI::format(_u8L("Cloud plugin UUID is not a valid identifier: %1%"), cloud_uuid));
const fs::path plugin_root = is_cloud_install && !cloud_user_id.empty() ? fs::path(get_cloud_plugin_dir(cloud_user_id)) :
local_plugin_root();
fs::create_directories(plugin_root, ec);
if (ec)
return fail("Failed to create plugin directory " + plugin_root.string() + ": " + ec.message());
// TRN %1% is a folder path, %2% the system error message.
return fail(GUI::format(_u8L("Failed to create plugin directory %1%: %2%"), plugin_root.string(), ec.message()));
std::string meta_error;
if (is_cloud_install) {
@@ -673,7 +685,8 @@ bool install_plugin(const boost::filesystem::path& filepath,
backup_dir = plugin_root / (final_dir.filename().string() + ".backup-" + fs::unique_path("%%%%-%%%%-%%%%").string());
fs::rename(final_dir, backup_dir, ec);
if (ec)
return fail("Failed to backup existing plugin " + final_dir.string() + ": " + ec.message());
// TRN %1% is a folder path, %2% the system error message.
return fail(GUI::format(_u8L("Failed to back up existing plugin %1%: %2%"), final_dir.string(), ec.message()));
backup_created = true;
}
@@ -684,7 +697,7 @@ bool install_plugin(const boost::filesystem::path& filepath,
boost::system::error_code restore_ec;
fs::rename(backup_dir, final_dir, restore_ec);
}
return fail("Failed to create plugin directory " + final_dir.string() + ": " + ec.message());
return fail(GUI::format(_u8L("Failed to create plugin directory %1%: %2%"), final_dir.string(), ec.message()));
}
fs::copy_file(source_path, dest_file, ec);
@@ -694,7 +707,8 @@ bool install_plugin(const boost::filesystem::path& filepath,
fs::remove_all(final_dir, restore_ec);
fs::rename(backup_dir, final_dir, restore_ec);
}
return fail("Failed to copy plugin file to " + dest_file.string() + ": " + ec.message());
// TRN %1% is a file path, %2% the system error message.
return fail(GUI::format(_u8L("Failed to copy plugin file to %1%: %2%"), dest_file.string(), ec.message()));
}
// Update entry_path to the installed location.
@@ -714,7 +728,7 @@ bool install_plugin(const boost::filesystem::path& filepath,
fs::remove_all(final_dir, rollback_ec);
if (backup_created)
fs::rename(backup_dir, final_dir, rollback_ec);
return fail("Failed to write plugin install state: " + (final_dir / INSTALL_STATE_FILE).string());
return fail(GUI::format(_u8L("Failed to write plugin install state: %1%"), (final_dir / INSTALL_STATE_FILE).string()));
}
}
+3 -1
View File
@@ -14,12 +14,14 @@ struct Plugin;
} // namespace Slic3r
namespace Slic3r::plugin_loader {
// registration_failed, when given, is set if the plugin's own registration step rejected the load.
bool load(const PluginDescriptor& descriptor,
bool skip_deps,
const std::vector<std::string>& capabilities_to_enable,
const std::function<std::string(const Plugin&)>& registry_precheck,
Plugin& out,
std::string& error);
std::string& error,
bool* registration_failed = nullptr);
// Run on_unload() on every capability, drop them, and release the module. Safe to call on a
// not-loaded Plugin, and safe after the interpreter has been finalized (in which case the module
+42 -38
View File
@@ -18,7 +18,9 @@
#include "OrcaCloudServiceAgent.hpp"
#include "libslic3r/Semver.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/NotificationManager.hpp"
#include "slic3r/GUI/format.hpp"
#include <boost/filesystem.hpp>
#include <boost/log/trivial.hpp>
@@ -204,7 +206,7 @@ std::string PluginManager::check_registry_locked(const std::string& plugin_key,
{
const Plugin* entry = find_plugin_locked(plugin_key);
if (entry != nullptr && entry->is_loaded())
return "Plugin package is already loaded: " + plugin_key;
return GUI::format(_u8L("Plugin package is already loaded: %1%"), plugin_key);
// A capability name must be unique per type across every loaded package.
for (const auto& capability : candidate.capabilities) {
@@ -215,8 +217,9 @@ std::string PluginManager::check_registry_locked(const std::string& plugin_key,
continue;
for (const auto& existing : other.capabilities) {
if (existing && existing->type() == capability->type() && existing->name() == capability->name())
return "Capability collision for type " + plugin_capability_type_to_string(capability->type()) + " and name '" +
capability->name() + "'";
// TRN %1% is the capability type (e.g. Script), %2% the capability name.
return GUI::format(_u8L("Capability collision for type %1% and name '%2%'"),
PluginConfig::capability_type_label(capability->type()), capability->name());
}
}
}
@@ -313,7 +316,7 @@ void PluginManager::merge_discovered_plugins(std::vector<PluginDescriptor> disco
continue;
if (std::find(seen.begin(), seen.end(), descriptor.plugin_key) != seen.end()) {
const std::string duplicate_error = "Duplicate plugin key discovered: " + descriptor.plugin_key;
const std::string duplicate_error = GUI::format(_u8L("Duplicate plugin key discovered: %1%"), descriptor.plugin_key);
if (Plugin* existing = find_plugin_locked(descriptor.plugin_key)) {
existing->descriptor.set_error(duplicate_error);
BOOST_LOG_TRIVIAL(error) << duplicate_error << " (" << existing->descriptor.entry_path << ", "
@@ -687,7 +690,7 @@ bool PluginManager::wait_for_plugin_load(const std::string& plugin_key, std::chr
if (timeout == std::chrono::milliseconds::max()) {
m_load_cv.wait(lock, done);
} else if (!m_load_cv.wait_for(lock, timeout, done)) {
error = "Plugin load is still in progress";
error = _u8L("Plugin load is still in progress");
return false;
}
@@ -854,11 +857,11 @@ void PluginManager::load_plugin(const std::string& plugin_key, bool skip_deps, s
if (!exists || invalid) {
std::string message;
if (invalid) {
message = "Plugin is invalid: " + plugin_id;
message = GUI::format(_u8L("Plugin is invalid: %1%"), plugin_id);
if (!invalid_error.empty())
message += " - " + invalid_error;
} else {
message = "Plugin not found: " + plugin_id;
message = GUI::format(_u8L("Plugin not found: %1%"), plugin_id);
}
{
@@ -892,9 +895,9 @@ void PluginManager::load_plugin(const std::string& plugin_key, bool skip_deps, s
try {
load_plugin_impl(plugin_id, skip_deps, capabilities_to_enable);
} catch (const std::exception& ex) {
fail_unexpected(std::string("Unexpected plugin load failure: ") + ex.what());
fail_unexpected(GUI::format(_u8L("Unexpected plugin load failure: %1%"), ex.what()));
} catch (...) {
fail_unexpected("Unexpected plugin load failure");
fail_unexpected(_u8L("Unexpected plugin load failure"));
}
if (!m_shutting_down.load(std::memory_order_acquire))
@@ -920,7 +923,7 @@ void PluginManager::load_plugin_impl(const std::string& plugin_key, bool skip_de
PluginDescriptor descriptor;
if (!try_get_plugin_descriptor(plugin_key, descriptor)) {
fail("Plugin manifest not found: " + plugin_key);
fail(GUI::format(_u8L("Plugin manifest not found: %1%"), plugin_key));
return;
}
@@ -936,10 +939,11 @@ void PluginManager::load_plugin_impl(const std::string& plugin_key, bool skip_de
Plugin plugin;
std::string error;
if (!plugin_loader::load(descriptor, skip_deps, capabilities_to_enable, registry_precheck, plugin, error)) {
bool registration_failed = false;
if (!plugin_loader::load(descriptor, skip_deps, capabilities_to_enable, registry_precheck, plugin, error, &registration_failed)) {
if (error == LOAD_CANCELLED)
return; // cancelled: nothing materialized survives, and no error is recorded
if (error.rfind("Plugin registration failed:", 0) == 0)
if (registration_failed)
mark_plugin_install_state_disabled(plugin_key);
fail(std::move(error));
return;
@@ -968,7 +972,7 @@ void PluginManager::load_plugin_impl(const std::string& plugin_key, bool skip_de
if (registry_error.empty()) {
Plugin* entry = find_plugin_locked(plugin_key);
if (entry == nullptr) {
registry_error = "Plugin manifest not found: " + plugin_key;
registry_error = GUI::format(_u8L("Plugin manifest not found: %1%"), plugin_key);
} else {
// Move everything via Plugin's own move assignment, but the package's
// descriptor (identity/metadata) belongs to the registry entry, not to the
@@ -1582,7 +1586,7 @@ void PluginManager::fetch_plugins_from_cloud(std::vector<std::string>* out_not_f
return;
plater->get_notification_manager()->push_notification(GUI::NotificationType::CustomNotification,
GUI::NotificationManager::NotificationLevel::WarningNotificationLevel,
"Failed to fetch plugins from the cloud. See logs for details.");
_u8L("Failed to fetch plugins from the cloud. See logs for details."));
});
}
}
@@ -1650,11 +1654,11 @@ bool PluginManager::subscribe_and_install_cloud_plugin(const std::string& plugin
const std::string plugin_uuid = is_uuid(plugin_key) ? plugin_key : std::string{};
if (plugin_uuid.empty()) {
error = "Cloud plugin key is missing UUID.";
error = _u8L("Cloud plugin key is missing UUID.");
return false;
}
if (!m_cloud_service.can_fetch_cloud_plugins()) {
error = "Sign in to OrcaCloud to install this plugin.";
error = _u8L("Sign in to OrcaCloud to install this plugin.");
return false;
}
@@ -1672,7 +1676,7 @@ bool PluginManager::subscribe_and_install_cloud_plugin(const std::string& plugin
fetch_plugins_from_cloud();
found = try_get_plugin_descriptor(plugin_key, descriptor) && descriptor.is_cloud_plugin();
if (!found) {
error = "Subscribed cloud plugin was not returned by OrcaCloud.";
error = _u8L("Subscribed cloud plugin was not returned by OrcaCloud.");
return false;
}
}
@@ -1690,7 +1694,7 @@ bool PluginManager::download_and_install_cloud_plugin(const std::string& plugin_
CloudPluginDownload download;
PluginDescriptor descriptor;
if (!try_get_plugin_descriptor(plugin_key, descriptor)) {
error = "Plugin not found: " + plugin_key;
error = GUI::format(_u8L("Plugin not found: %1%"), plugin_key);
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": Failed to find plugin key " << plugin_key;
return false;
}
@@ -1700,7 +1704,7 @@ bool PluginManager::download_and_install_cloud_plugin(const std::string& plugin_
const std::string requested_version = version.empty() ? descriptor.version : version;
if (!m_cloud_service.download_cloud_plugin(descriptor, requested_version, download, error)) {
if (error.empty())
error = "Failed to download cloud plugin.";
error = _u8L("Failed to download cloud plugin.");
set_plugin_error(plugin_key, error);
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": " << error;
return false;
@@ -1720,7 +1724,7 @@ bool PluginManager::download_and_install_cloud_plugin(const std::string& plugin_
if (!install_plugin(download.package_path, descriptor, error)) {
if (error.empty())
error = "Failed to install cloud plugin.";
error = _u8L("Failed to install cloud plugin.");
set_plugin_error(plugin_key, error);
boost::system::error_code ec;
boost::filesystem::remove(download.package_path, ec);
@@ -1746,7 +1750,7 @@ bool PluginManager::download_and_install_cloud_plugin(const std::string& plugin_
std::lock_guard<std::mutex> lock(m_mutex);
Plugin* entry = find_plugin_locked(plugin_key);
if (entry == nullptr) {
error = "Plugin not found.";
error = _u8L("Plugin not found.");
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": Cloud plugin " << plugin_key
<< " downloaded successfully but failed to update plugin metadata. Plugin object not found.";
} else {
@@ -1768,12 +1772,12 @@ bool PluginManager::update_cloud_plugin(const std::string& plugin_key, std::stri
PluginDescriptor descriptor;
if (!try_get_plugin_descriptor(plugin_key, descriptor)) {
error = "Plugin not found: " + plugin_key;
error = GUI::format(_u8L("Plugin not found: %1%"), plugin_key);
return false;
}
if (!descriptor.is_cloud_plugin()) {
error = "Only cloud plugins can be updated.";
error = _u8L("Only cloud plugins can be updated.");
set_plugin_error(plugin_key, error);
return false;
}
@@ -1784,7 +1788,7 @@ bool PluginManager::update_cloud_plugin(const std::string& plugin_key, std::stri
if (descriptor.cloud->update_available) {
version = descriptor.latest_available_version();
} else {
error = "Trying to update plugin with no available update. Version is empty.";
error = _u8L("No update is available for this plugin.");
set_plugin_error(plugin_key, error);
return false;
}
@@ -1798,7 +1802,7 @@ bool PluginManager::update_cloud_plugin(const std::string& plugin_key, std::stri
{
std::lock_guard<std::mutex> lock(m_mutex);
resolved_allowed_plugin_root = resolve_allowed_plugin_root(descriptor, get_plugin_directories(m_cloud_user_id),
"Refusing to delete a plugin outside the known plugin directories.",
_u8L("Refusing to delete a plugin outside the known plugin directories."),
resolved_root, error);
}
@@ -1835,7 +1839,7 @@ bool PluginManager::delete_installed_plugin_package(const PluginDescriptor& plug
{
std::lock_guard<std::mutex> lock(m_mutex);
resolved_allowed_plugin_root = resolve_allowed_plugin_root(plugin, get_plugin_directories(m_cloud_user_id),
"Refusing to delete a plugin outside the known plugin directories.",
_u8L("Refusing to delete a plugin outside the known plugin directories."),
resolved_root, error);
}
if (!resolved_allowed_plugin_root)
@@ -1866,7 +1870,7 @@ bool PluginManager::keep_installed_plugin_as_local(const PluginDescriptor& plugi
{
std::lock_guard<std::mutex> lock(m_mutex);
resolved_allowed_plugin_root = resolve_allowed_plugin_root(plugin_descriptor, get_plugin_directories(m_cloud_user_id),
"Refusing to update a plugin outside the known plugin directories.",
_u8L("Refusing to update a plugin outside the known plugin directories."),
resolved_root, error);
}
@@ -1892,12 +1896,12 @@ bool PluginManager::keep_installed_plugin_as_local(const PluginDescriptor& plugi
Plugin* entry = find_plugin_locked(old_key);
if (entry == nullptr) {
error = "Plugin manifest not found: " + old_key;
error = GUI::format(_u8L("Plugin manifest not found: %1%"), old_key);
return false;
}
if (find_plugin_locked(new_key) != nullptr && new_key != old_key) {
error = "Cannot keep plugin local: local plugin key already exists: " + new_key;
error = GUI::format(_u8L("Cannot keep plugin local: local plugin key already exists: %1%"), new_key);
BOOST_LOG_TRIVIAL(warning) << error;
return false;
}
@@ -1917,7 +1921,7 @@ bool PluginManager::keep_installed_plugin_as_local(const PluginDescriptor& plugi
if (install_state.installed_version.empty())
install_state.installed_version = local_descriptor.version;
if (!write_install_state(resolved_root, install_state)) {
error = "Failed to update plugin install state: " + (resolved_root / INSTALL_STATE_FILE).string();
error = GUI::format(_u8L("Failed to update plugin install state: %1%"), (resolved_root / INSTALL_STATE_FILE).string());
return false;
}
@@ -1985,7 +1989,7 @@ bool PluginManager::delete_plugin(const std::string& plugin_key, std::string& er
PluginDescriptor descriptor;
if (!try_get_plugin_descriptor(plugin_key, descriptor)) {
error = "Plugin not found: " + plugin_key;
error = GUI::format(_u8L("Plugin not found: %1%"), plugin_key);
return false;
}
@@ -2007,18 +2011,18 @@ bool PluginManager::unsubscribe_cloud_plugin(const std::string& plugin_key, std:
PluginDescriptor descriptor;
if (!try_get_plugin_descriptor(plugin_key, descriptor)) {
error = "Plugin not found: " + plugin_key;
error = GUI::format(_u8L("Plugin not found: %1%"), plugin_key);
return false;
}
if (!descriptor.is_cloud_plugin()) {
error = "Only cloud plugins can be unsubscribed.";
error = _u8L("Only cloud plugins can be unsubscribed.");
set_plugin_error(plugin_key, error);
return false;
}
if (descriptor.cloud && descriptor.cloud->is_mine) {
error = "Cannot unsubscribe your own plugins.";
error = _u8L("Cannot unsubscribe your own plugins.");
set_plugin_error(plugin_key, error);
return false;
}
@@ -2040,18 +2044,18 @@ bool PluginManager::delete_and_unsubscribe_cloud_plugin(const std::string& plugi
PluginDescriptor descriptor;
if (!try_get_plugin_descriptor(plugin_key, descriptor)) {
error = "Plugin not found: " + plugin_key;
error = GUI::format(_u8L("Plugin not found: %1%"), plugin_key);
return false;
}
if (!descriptor.is_cloud_plugin()) {
error = "Only cloud plugins can be deleted and unsubscribed.";
error = _u8L("Only cloud plugins can be deleted and unsubscribed.");
set_plugin_error(plugin_key, error);
return false;
}
if (descriptor.cloud->is_mine) {
error = "Cannot unsubscribe your own plugins. Use Delete to remove the local files.";
error = _u8L("Cannot unsubscribe your own plugins. Use Delete to remove the local files.");
set_plugin_error(plugin_key, error);
return false;
}
@@ -2092,7 +2096,7 @@ ExecutionResult PluginManager::run_script_capability(const std::string& plugin_k
error = ex.what();
BOOST_LOG_TRIVIAL(error) << "Script plugin execution threw exception. plugin_key=" << plugin_key << " error=" << error;
} catch (...) {
error = "Unknown error";
error = _u8L("Unknown error");
BOOST_LOG_TRIVIAL(error) << "Script plugin execution threw unknown exception. plugin_key=" << plugin_key;
}
+5 -3
View File
@@ -7,6 +7,7 @@
#include "../GUI/GUI.hpp"
#include "../GUI/GUI_App.hpp"
#include "../GUI/I18N.hpp"
#include "../GUI/format.hpp"
#include "../GUI/Plater.hpp"
#include "../GUI/NotificationManager.hpp"
@@ -384,7 +385,7 @@ static void report_install_failure(const std::string& message)
if (GUI::Plater* plater = GUI::wxGetApp().plater())
plater->get_notification_manager()->push_notification(GUI::NotificationType::OrcaCloudAPIError,
GUI::NotificationManager::NotificationLevel::ErrorNotificationLevel,
_u8L("Plugin installation failed") + ": " + message);
GUI::format(_u8L("Plugin installation failed: %1%"), message));
});
}
@@ -427,13 +428,14 @@ void resolve_missing_plugins(const std::vector<std::string>& refs, PluginInstall
}
PluginDescriptor descriptor;
if (!mgr.try_get_plugin_descriptor(uuid, descriptor)) {
report_install_failure(uuid + ": installed plugin was not found in the catalog.");
// TRN %1% is the plugin's cloud ID.
report_install_failure(GUI::format(_u8L("%1%: installed plugin was not found in the catalog."), uuid));
continue;
}
mgr.load_plugin(descriptor.plugin_key, false);
if (!mgr.wait_for_plugin_load(descriptor.plugin_key, std::chrono::minutes(5), error) ||
!mgr.is_plugin_loaded(descriptor.plugin_key)) {
report_install_failure(descriptor.name + ": " + (error.empty() ? "plugin failed to load." : error));
report_install_failure(descriptor.name + ": " + (error.empty() ? _u8L("Plugin failed to load.") : error));
}
}
if (progress.on_finished)
+2 -1
View File
@@ -29,6 +29,7 @@
#include "pluginTypes/slicingPipeline/SlicingPipelinePluginCapability.hpp"
#include <pybind11/pytypes.h>
#include <pybind11/gil.h>
#include "slic3r/GUI/I18N.hpp"
namespace py = pybind11;
@@ -191,7 +192,7 @@ std::vector<CapturedCapability> PythonPluginBridge::finalize_plugin_capture(cons
granted = PluginAuditManager::instance().request_filesystem_read_permissions(plugin_key, fs_read_permissions);
}
if (!granted) {
error = "Plugin filesystem read permission request denied";
error = _u8L("Plugin filesystem read permission request denied");
BOOST_LOG_TRIVIAL(warning) << error << " for key " << plugin_key;
discard_pending_for_key();
clear_active_key();