Gettin Application Settings in Plugin

Hi everyone!

I am developing an action that can be performed by clicking on a ribbon button in the UI.
For the execution I want to access the application settings to verify they are set correctly. Ideally I also want to change the settings but this is not mandatory. And it would also be useful to access the settings for a translation provider plugin I am developing.

The version I am targeting is Trados Studio 2024.

Specifically I want to access the Editor settings you get by clicking on "File -> Options -> Editor" and also the Automation Settings in "File -> Options -> Editor -> Automation" but it would be nice to be able to access all settings there


I tried to find something via `SdlTradosStudio.Application` but could not find a reference to settings. My guess is that there could be a Service for settings? I also could not find a `SettingsService` but my approach was to search for "service" in the documentation. (Additional question: how do I know which services there are? Is there a list somewhere?)

I also tried to access the application settings via the project settings:

var currentProject = SdlTradosStudio.Application.GetController<ProjectsController>().CurrentProject;
var settingIds = currentProject.GetSettings().GetSettingsGroupIds()

But this only gave me these settings:

TerminologyProviderSettings
Copy of XML v 2.0.0.0
PublishProjectOperationSettings
ProjectPlanningSettings
Plugin.AnyTM.SourceLanguages
TranslateTaskSettings
TranslationMemorySettings
FilesView

Which does not look helpful.

In a last attempt I tried to get the settings via the EditorController because the settings I want to access are related to that controller but also no luck.

Is it possible somehow to access the application settings?

Parents
  • Hi  , it’s not straightforward at first understanding how to work with the Trados Studio API; feel that

    1.
    Application Settings are typically user-scoped and global (like the Editor and Automation settings you see under File > Options).
    Project Settings are specific to a project (under Project Settings) and accessible via the project context.

    The Plugin API usually gives you direct access to Project Settings, as you’ve discovered. Application settings (those globl ones set in File > Options) are not alwways exposed directly via the public API for developers. This is by design, mostly to protect user scope data.

    2.
    For in-scope settings (like per-project or per-provider), you’ll work with the ISettingsBundle and ISettingsGroup interfaces:

    var project = SdlTradosStudio.Application.GetController<ProjectsController>().CurrentProject;
    var settingsBundle = project.GetSettings();  // Project-specific settings
    
    foreach (var groupId in settingsBundle.GetSettingsGroupIds())
    {
        var group = settingsBundle.GetSettingsGroup(groupId);
        // Explore properties in this group
    }


    Editor/Application global settings, like those in File > Options > Editor, are not currently exposed via a public API. The UI layer manages them, and while certain settings may be mirrored on a project level, global settings typically are not accessible programmatically to plugins (except if specifically exposed by another API).

    Links & References

Reply
  • Hi  , it’s not straightforward at first understanding how to work with the Trados Studio API; feel that

    1.
    Application Settings are typically user-scoped and global (like the Editor and Automation settings you see under File > Options).
    Project Settings are specific to a project (under Project Settings) and accessible via the project context.

    The Plugin API usually gives you direct access to Project Settings, as you’ve discovered. Application settings (those globl ones set in File > Options) are not alwways exposed directly via the public API for developers. This is by design, mostly to protect user scope data.

    2.
    For in-scope settings (like per-project or per-provider), you’ll work with the ISettingsBundle and ISettingsGroup interfaces:

    var project = SdlTradosStudio.Application.GetController<ProjectsController>().CurrentProject;
    var settingsBundle = project.GetSettings();  // Project-specific settings
    
    foreach (var groupId in settingsBundle.GetSettingsGroupIds())
    {
        var group = settingsBundle.GetSettingsGroup(groupId);
        // Explore properties in this group
    }


    Editor/Application global settings, like those in File > Options > Editor, are not currently exposed via a public API. The UI layer manages them, and while certain settings may be mirrored on a project level, global settings typically are not accessible programmatically to plugins (except if specifically exposed by another API).

    Links & References

Children
No Data