Skip to content
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

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

hakermi
Copy link
Member

@hakermi hakermi commented Oct 12, 2023

This PR adds a new automatic extension point

@hakermi hakermi force-pushed the TASK-65429-1 branch 2 times, most recently from cdcbe23 to 5bfec4a Compare October 13, 2023 09:46
Comment on lines 103 to 113
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);
});
},
});
Copy link
Member

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 ?

Copy link
Member Author

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 ?

Copy link
Member

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').

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT ?

Copy link
Member Author

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).

Copy link
Member

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

Copy link
Member Author

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

@hakermi hakermi requested a review from rdenarie October 13, 2023 13:13
@hakermi hakermi force-pushed the TASK-65429-1 branch 2 times, most recently from 1c5cc82 to 3399d68 Compare October 13, 2023 13:15
@@ -100,6 +100,17 @@
},
});

extensionRegistry.registerExtension('notes-automatic-translation', 'auto-translate', {
Copy link
Member

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'

Copy link
Member Author

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
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@exo-swf exo-swf marked this pull request as draft October 13, 2023 13:47
@exo-swf
Copy link
Contributor

exo-swf commented Oct 13, 2023

Your PR triggers too many exo-ci builds! Please finish your work and then, set your PR ready! Thank you

@hakermi hakermi marked this pull request as ready for review October 13, 2023 13:52
Copy link
Member

@rdenarie rdenarie left a 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

@hakermi hakermi requested a review from mkrout October 13, 2023 14:18
@hakermi hakermi merged commit 780c70e into feature/experience Oct 13, 2023
@hakermi hakermi deleted the TASK-65429-1 branch October 13, 2023 14:50
exo-swf pushed a commit that referenced this pull request Oct 20, 2023
This PR adds a new automatic extension point
exo-swf pushed a commit that referenced this pull request Oct 22, 2023
This PR adds a new automatic extension point
hakermi added a commit that referenced this pull request Oct 23, 2023
This PR adds a new automatic extension point

feat: Add automatic-translation extension for notes - EXO-65429 (#47)

Add automatic-translation extension for notes
hakermi added a commit that referenced this pull request Oct 23, 2023
This PR adds a new automatic extension point

feat: Add automatic-translation extension for notes - EXO-65429 (#47)

Add automatic-translation extension for notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants