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

233 auto translation flag #302

Merged
merged 35 commits into from
Mar 7, 2024
Merged

233 auto translation flag #302

merged 35 commits into from
Mar 7, 2024

Conversation

sorochak
Copy link
Contributor

Description

The primary objective of these changes is to flag unverified translations and provide an auto-translation method message, thereby improving the accuracy of translations across different sections of the application.

When the user clicks the TRANSLATE button, a new field is added to the record object that stores an auto-translation method message for the metadata entry field being translated. A checkbox has been added beside the translate button to indicate whether the user has verified the translation. If the checkbox is checked, the auto-translation method message for the field being translated is not passed on to the yaml file. If the checkbox is not checked, an auto-translation method message for the field is passed on to the yaml file.

This PR solves the problem outlined in #233

The key features and fixes introduced are summarized as follows:

  • added a new translationVerified checkbox to the BilingualTextInput component. This inclusion allows users to explicitly mark translations as verified in various sections of the metadata entry form, including title, abstract, limitations, and platform description.

  • defined the handler function handleTranslationComplete to dynamically generate field names that the identify translation method of various metadata fields.

  • defined the verify_translation python function in record_json_to_yaml.py which only returns the auto-translation method message if the translation has not been verified by the user.

  • in the record_json_to_yaml python function, added the translation method fields for title, abstract, limitations, and platform description, because those are the metadata fields we currently have automatic translation available for. These fields call the above verify_translation function for their value.

@sorochak sorochak added this to the Code Sprint 2023 - Metadata milestone Jan 12, 2024
@sorochak sorochak requested review from fostermh and n-a-t-e January 12, 2024 18:29
@sorochak sorochak self-assigned this Jan 12, 2024
@sorochak sorochak linked an issue Jan 12, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Jan 12, 2024

Visit the preview URL for this PR (updated for commit ed7314f):

https://cioos-metadata-form--pr302-233-auto-translation-iiy18mm1.web.app

(expires Thu, 28 Mar 2024 00:36:12 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 57eda2a7622dc877ccadb675a0532261c52b09fd

@sorochak
Copy link
Contributor Author

might need to bulk change historical data records for auto translate

@sorochak sorochak marked this pull request as draft January 16, 2024 18:01
@sorochak
Copy link
Contributor Author

There's translate buttons in the resource tab, which translate names and descriptions of resources.

Do we want the names and descriptions of resources to have auto translate flags? Those are stored in the distribution field of a record. So, would it be applicable/useful? currently metadata-xml checks the record for specific auto translate flags so that users in the catalogue can be notified of an unverified translation.

@sorochak sorochak marked this pull request as ready for review February 23, 2024 01:17
@fostermh
Copy link
Member

what happens when someone edits an existing record? do they have to modify each of the translated fields to get the new key to show up? I think they likely do at the moment.

@sorochak sorochak force-pushed the 233-auto-translation-flag branch from a12549b to 059803b Compare February 27, 2024 00:19
@sorochak
Copy link
Contributor Author

@fostermh users no longer need to modify each of the translated fields to get the new key to show up. However, they still need to visit a tab that contains translations. The BilingualTextInput instances need to mount to update the record with translations fields.

@sorochak sorochak merged commit 0a6b4a4 into main Mar 7, 2024
3 checks passed
@sorochak sorochak deleted the 233-auto-translation-flag branch March 7, 2024 00:22
@sorochak sorochak restored the 233-auto-translation-flag branch March 7, 2024 01:25
@sorochak sorochak deleted the 233-auto-translation-flag branch March 7, 2024 01:59
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.

auto translation flag
2 participants