Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm working on a custom integration for a translation service a client uses, but I'm unsure how to access the settings set during configuration inside the custom TranslationProvider. I did notice a ProviderProperties field on the TranslationJob object, which I assume includes this information, but this object isn't available in the Active method. I want to flag it as active if it has an api key set in its settings. Is this possible?
While I can get around this by adding the api key in app settings, I would like to manage all of the configuration in a single place that an umbraco user can easily access.
There are helper methods that allow you to get to the provider settings in the translations.config file.
so within the provider, this would get the value for 'apiKey'
_apiKey = TranslateConfigHelper.GetProviderSetting(this.Alias, "apiKey");
there is also a generic version GetProviderSetting<TValue>(string providerName, string key, TValue defaultValue)
which will let you get the value by type, e.g.
GetProviderSetting<TValue>(string providerName, string key, TValue defaultValue)
int throttle = TranslateConfigHelper.GetProviderSetting(this.Alias, "throttle", 100);
Also worth noting that if you store these values within the class, then you should load them in the Reload method, this is called by translation Manager when a user saves settings via the UI,
Thanks for the quick response Kevin.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted