mattermost-community / mattermost-plugin-autotranslate

Apache License 2.0
41 stars 19 forks source link

Update api.go #40

Closed daniron26 closed 3 years ago

daniron26 commented 3 years ago

Summary

Change language code error test from len==2 to 2 <= len <= 5

the current version will reject correct language codes like "fr-CA" and other language codes that has length == 5

Ticket Link

Fixes https://github.com/mattermost/mattermost-plugin-autotranslate/issues/38

mattermod commented 3 years ago

Hello @daniron26,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

Per the Mattermost Contribution Guide, we need to add you to the list of approved contributors for the Mattermost project.

Please help complete the Mattermost contribution license agreement? Once you have signed the CLA, please comment with /check-cla and confirm that the CLA check is green.

This is a standard procedure for many open source projects.

Please let us know if you have any questions.

We are very happy to have you join our growing community! If you're not yet a member, please consider joining our Contributors community channel to meet other contributors and discuss new opportunities with the core team.

daniron26 commented 3 years ago

/check-cla

saturninoabril commented 3 years ago

Awesome, thanks @daniron26! Will take a look at this.

hanzei commented 3 years ago

/update-branch

saturninoabril commented 3 years ago

@daniron26 Thanks for updating. Could you please confirm if the recent change works for you?

daniron26 commented 3 years ago

Thanks @daniron26! LGTM. Could you please do the same for source?

Its been changed, let me know if I missed anything.

@daniron26 Thanks for updating. Could you please confirm if the recent change works for you?

Yes it does, happy to be a part of this.

saturninoabril commented 3 years ago

@daniron26 I'm getting the following error since the source could have a value of auto: Screen Shot 2021-02-16 at 2 44 03 PM

With that, we can probably relax the length check in source.

daniron26 commented 3 years ago

@daniron26 I'm getting the following error since the source could have a value of auto: Screen Shot 2021-02-16 at 2 44 03 PM

With that, we can probably relax the length check in source.

I think so, changing it back to 2 >= len >= 5