Created translate view #998

Closed
c22abdal wants to merge 0 commits from #977-Translator-API into team_2_week_6
Collaborator

Created a new Translation View using the FreeDictionaryApi.
The view demonstrates the API’s translation and dictionary capabilities through a simple interface with:

  • one input field for entering a word
  • one dropdown for selecting the source language
  • one dropdown for selecting the target language

During implementation, it became clear that the API is more dictionary-focused than a full translation service. It works best when translating from English to other languages, while translations from other languages are often limited or inconsistent depending on the available Wiktionary data.

Current behavior

  • English words can usually be translated successfully into many supported languages.
  • Translations between non-English languages may not always return results.
  • Some non-English searches instead provide definitions or dictionary-style explanations in English.

Notes

The current implementation was kept to demonstrate the API’s functionality and explore its capabilities in practice.

A possible workaround would be to use the returned definitions/senses as fallback translations when direct translations are unavailable. However, this approach is inconsistent and may not provide accurate results.

For a more reliable multilingual translation experience, a dedicated translation API would likely be a better long-term solution.

Created a new Translation View using the FreeDictionaryApi. The view demonstrates the API’s translation and dictionary capabilities through a simple interface with: - one input field for entering a word - one dropdown for selecting the source language - one dropdown for selecting the target language During implementation, it became clear that the API is more dictionary-focused than a full translation service. It works best when translating from English to other languages, while translations from other languages are often limited or inconsistent depending on the available Wiktionary data. ## Current behavior - English words can usually be translated successfully into many supported languages. - Translations between non-English languages may not always return results. - Some non-English searches instead provide definitions or dictionary-style explanations in English. ## Notes The current implementation was kept to demonstrate the API’s functionality and explore its capabilities in practice. A possible workaround would be to use the returned definitions/senses as fallback translations when direct translations are unavailable. However, this approach is inconsistent and may not provide accurate results. For a more reliable multilingual translation experience, a dedicated translation API would likely be a better long-term solution.
Collaborator

Review on #998

Whats done

Tested on macOS using Chrome

  • App starts
  • Tested adding the translation view to dashboard
  • Tested translations between different languages

Inspected following files

  • translationView.js
    • Indentation/code styling
      • Follows standard
    • Naming convention
      • Some text is hardcoded instead of using localization keys.
      • File name should change to TranslationView.js
    • Comments
      • No comment found, could add some comments for important logic
    • General code quality
      • Code is well structured
  • translator.module.css
    • Indentation/code styling
      • Follows standard
    • Naming convention
      • File name should change to Translator.module.css
    • Comments
      • Missing comments
    • General code quality
      • No issues found
  • Dashboard.js
    • General code quality
      • Not following localization standard for title and category
  • tooltipConfig.js, viewConfig.js, useDictionaryLookup.js
    • General code quality
      • No issues found

What needs to be done

  • Replace hardcoded text with localization keys
  • Rename translationView.js and translator.module.css

Conclusion

After testing the view, I think the current card can give a different idea of how the translation works. The From, To and Translate makes it feel like direct translation but some searches return no results because the API works more like a dictionary lookup. One suggestion is to change the text or layout a bit so that its cleare for users.

# Review on #998 ## Whats done ### Tested on macOS using Chrome + App starts + Tested adding the translation view to dashboard + Tested translations between different languages ### Inspected following files + translationView.js + Indentation/code styling + Follows standard + Naming convention + Some text is hardcoded instead of using localization keys. + File name should change to TranslationView.js + Comments + No comment found, could add some comments for important logic + General code quality + Code is well structured + translator.module.css + Indentation/code styling + Follows standard + Naming convention + File name should change to Translator.module.css + Comments + Missing comments + General code quality + No issues found + Dashboard.js + General code quality + Not following localization standard for title and category + tooltipConfig.js, viewConfig.js, useDictionaryLookup.js + General code quality + No issues found ## What needs to be done + Replace hardcoded text with localization keys + Rename translationView.js and translator.module.css ## Conclusion After testing the view, I think the current card can give a different idea of how the translation works. The `From`, `To` and `Translate` makes it feel like direct translation but some searches return no results because the API works more like a dictionary lookup. One suggestion is to change the text or layout a bit so that its cleare for users.
Author
Collaborator

I changed the view to make more sense of what it does.
Followed the review and renamed the files. However, I am having issues with renaming CSS files GitHub is not recognizing the change, so to avoid errors i didn't change the file's name.

I changed the view to make more sense of what it does. Followed the review and renamed the files. However, I am having issues with renaming CSS files GitHub is not recognizing the change, so to avoid errors i didn't change the file's name.
b23albst left a comment
Collaborator

Review on #998

Whats done

Reviewed the code and tested the card

Tested on ubuntu using firefox

  • App starts [IF the app starts]
    • The view works as intended
    • Nothing else breaks

Inspected following files

  • Indentation/code styling ok
  • CSS standard ok
  • Naming convention ok
  • Printed text uses and follows localization standards
    • No localization
  • Comments ok

What needs to be done

  • Localization of views is an ongoing project and I think there are some parts where you could switch text to localization keys.
    • An example is the title set in Dashboard.js, where some other views use localization

Conclusion

  • Add localization at least to the view title, maybe more if there is time. Other than that, this can be merged
# Review on #998 ## Whats done Reviewed the code and tested the card ### Tested on ubuntu using firefox + App starts [IF the app starts] + The view works as intended + Nothing else breaks ### Inspected following files + Indentation/code styling ok + CSS standard ok + Naming convention ok + Printed text uses and follows localization standards + No localization + Comments ok ## What needs to be done + Localization of views is an ongoing project and I think there are some parts where you could switch text to localization keys. + An example is the title set in Dashboard.js, where some other views use localization ## Conclusion + Add localization at least to the view title, maybe more if there is time. Other than that, this can be merged
Collaborator

Even though localization has not been implemented, I think this is ready to be merged

Even though localization has not been implemented, I think this is ready to be merged
Collaborator

Ok will merge

Ok will merge
Collaborator

@c22abdal wrote in #998 (comment):

I changed the view to make more sense of what it does. Followed the review and renamed the files. However, I am having issues with renaming CSS files GitHub is not recognizing the change, so to avoid errors i didn't change the file's name.

It doesn’t care about uppercase changes. You can rename the file to anything, push it, then rename it again to follow the proper naming convention and push it once more.

@c22abdal wrote in https://git.webug.se/Andras/BoundlessFlowCampus2K/pulls/998#issuecomment-11815: > I changed the view to make more sense of what it does. Followed the review and renamed the files. However, I am having issues with renaming CSS files GitHub is not recognizing the change, so to avoid errors i didn't change the file's name. It doesn’t care about uppercase changes. You can rename the file to anything, push it, then rename it again to follow the proper naming convention and push it once more.
Collaborator

has merged manually

has merged manually
a22erigr closed this pull request 2026-05-20 07:58:12 +00:00
c24danli deleted branch #977-Translator-API 2026-05-27 11:58:18 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K!998
No description provided.