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

Integrated Hardcoded Translation Feature #49

Merged
merged 3 commits into from
Nov 12, 2024
Merged

Conversation

Abdallah-Abdaljalil
Copy link
Collaborator

@Abdallah-Abdaljalil Abdallah-Abdaljalil commented Nov 10, 2024

Integrated the hardcoded translation into our NodeBB deployment.

Changes Made

Additions:

src/translate/index.js

  • Created a file that does the actual translation. It contains the translation function that the create.js below uses. This file refers to the deployment of the translator service.

Modified Files:

public/src/client/topic.js

  • Flag was added so that when the user clicks the translate button, they see the post translated.

node_modules/nodebb-theme-harmony/templates/partials/topic/post.tpl

  • Where a check is made whether the post is in English or not. If it is not English, show the translate button, if it is already in English, don't show the button.

src/posts/create.js

  • This is where the translate function is actually called when creating a post to perform the translation.

src/posts/data.js

  • Added a line that marks whether the post is in English or not

@Abdallah-Abdaljalil Abdallah-Abdaljalil self-assigned this Nov 10, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11767375494

Details

  • 9 of 9 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 82.686%

Totals Coverage Status
Change from base Build 11591051685: 0.005%
Covered Lines: 22359
Relevant Lines: 25621

💛 - Coveralls

Copy link
Collaborator

@kwarraich kwarraich left a comment

Choose a reason for hiding this comment

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

looks good to me, the added code makes sense. should be good to merge

@kwarraich kwarraich merged commit 9c79ba6 into f24 Nov 12, 2024
2 checks passed
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.

3 participants