RocketChat / RocketChat/Rocket.Chat
Deprecated use of substr in googleTranslate.ts
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
There is a deprecated use of substr() in /apps/meteor/app/autotranslate/server/googleTranslate.ts that I found while doing a code review for a college class.
It isn't necessarily a bug or vulnerability in the code, not a new feature, but perhaps a code improvement.
The use of substr is in line 134 and 181, which I believe would be easily updated to slice(). I would volunteer to update this if the maintainers would like this to be updated.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open apps/meteor/app/autotranslate/server/googleTranslate.ts and inspect the substr() calls at lines 134 and 181. Confirm that replacing these deprecated calls with slice() preserves the existing translation behavior, then verify that no substr() use remains at those locations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 62/100