-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add automatic-translation extension - EXO-65429 #46
Conversation
cdcbe23
to
5bfec4a
Compare
extensionRegistry.registerExtension('automatic-translation', 'action', { | ||
id: 'auto-translate', | ||
rank: 1000, | ||
isEnabled: () => true, | ||
labelKey: 'UIActivity.label.translate', | ||
click: (message, callback) => { | ||
fetchTranslation(message).then(translated => { | ||
callback(translated.translation); | ||
}); | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we add this extension ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we add this extension ?
for the translate button in notes and news ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, the name of the extension is disturbing.
You named it 'automatic-translation', but should it be something like 'notes-translation' and 'news-translation' ?
For activities, the xtension is named "ActivityContent" or ('activity', 'comment-action').
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but i wanted to have one extension for both. that's why.
And i really don't know which is better: define one extension or two extensions(news-extension and notes-extension).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By using only one extension point, you will not be able in the future to add something in the news extension point but not in the notes extension point.
For me, it is better to have 2 extensions point, with a different name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok i will make two extensions
1c5cc82
to
3399d68
Compare
@@ -100,6 +100,17 @@ | |||
}, | |||
}); | |||
|
|||
extensionRegistry.registerExtension('notes-automatic-translation', 'auto-translate', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you named the extension point "notes-automatic-translation". Does that mean we only add autotranslation extension into ?
In fact, you named the extension point with a name which is related to the content of the extension, not of what is the extension point.
As the extension point is in notes, translation menu, I would name it "notes", with type 'translation-menu-extension'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name of extension updated
This PR adds a new automatic extension point
Kudos, SonarCloud Quality Gate passed! |
Your PR triggers too many exo-ci builds! Please finish your work and then, set your PR ready! Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok for me. I let @mkrout validates the PR as he have the complete view on the feature
This PR adds a new automatic extension point