Skip to content

Commit

Permalink
Allow passing custom plugin translations in window.qwc2.addPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Apr 18, 2024
1 parent 1fa94de commit fcc5ed1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/API.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ class API extends React.Component {
render() {
return null;
}
addPlugin = (name, plugin) => {
window.qwc2.customPlugins[name] = plugin;
addPlugin = (name, plugin, translations = {}) => {
window.qwc2.__customPlugins[name] = plugin;
window.qwc2.addTranslations(translations);
this.props.registerCustomPlugin(name);
};
removePlugin = (name) => {
Expand Down

0 comments on commit fcc5ed1

Please sign in to comment.