RocketChat / RocketChat/Rocket.Chat

Deprecated use of substr in googleTranslate.ts

Open Beginner friendly
#34,007 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

planned
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.