Skip to content

Internationalization of ingest messages#9571

Merged
kcondon merged 2 commits intoIQSS:developfrom
stevenferey:9570-untranslated-error-ingest-message
May 26, 2023
Merged

Internationalization of ingest messages#9571
kcondon merged 2 commits intoIQSS:developfrom
stevenferey:9570-untranslated-error-ingest-message

Conversation

@stevenferey
Copy link
Copy Markdown
Contributor

@stevenferey stevenferey commented May 3, 2023

What this PR does / why we need it:
Internationalization of ingest messages

Which issue(s) this PR closes:

Copy link
Copy Markdown
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

This looks good to me. Thanks, @stevenferey!

I'm going to give this our smallest size estimate because it shouldn't be hard to test.

file.spss-porExtraLabels.title=Upload an additional text file with extra variable labels.
file.spss-porExtraLabels.selectToAddBtn=Select File to Add
file.ingest.saveFailed.message=Ingest succeeded, but failed to save the ingested tabular data in the database; no further information is available
file.ingest.saveFailed.detail.message=Ingest succeeded, but failed to save the ingested tabular data in the database:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh good, there's a space after the : even though it's hard to see.

@pdurbin
Copy link
Copy Markdown
Member

pdurbin commented May 4, 2023

@stevenferey is a first time contributor (❤️ thanks! ❤️ ) so I had to click the "run" button for the checks.

@pdurbin pdurbin added Feature: Internationalization Size: 3 A percentage of a sprint. 2.1 hours. labels May 4, 2023
@stevenferey
Copy link
Copy Markdown
Contributor Author

Thanks for your feedback @pdurbin !

The error during the maven build is not to be related to the PR for me, is it?

Thanks,
Steven.

@pdurbin
Copy link
Copy Markdown
Member

pdurbin commented May 5, 2023

@stevenferey no, this error is unrelated to your pull request:

Failed to read schema document 'https://ddialliance.org/Specification/DDI-Codebook/2.5/XMLSchema/codebook.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

Internally, we've been discussing how to fix this: https://iqss.slack.com/archives/C010LA04BCG/p1682360103211409

@kcondon
Copy link
Copy Markdown
Contributor

kcondon commented May 26, 2023

@stevenferey Please refresh this branch from develop since there is an outdated flyway db script name in this branch that is causing trouble deploying. Thanks!

@kcondon kcondon self-assigned this May 26, 2023
@pdurbin
Copy link
Copy Markdown
Member

pdurbin commented May 26, 2023

I took care of the merge.

@kcondon
Copy link
Copy Markdown
Contributor

kcondon commented May 26, 2023 via email

Copy link
Copy Markdown
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

I tested this by artificially adding some runtime exceptions, which I didn't commit, of course. Looks good to me. Thanks, @stevenferey!

errorReport.setFailure();
if (ex.getMessage() != null) {
errorReport.setReport("Ingest succeeded, but failed to save the ingested tabular data in the database: " + ex.getMessage());
errorReport.setReport(BundleUtil.getStringFromBundle("file.ingest.saveFailed.detail.message") + ex.getMessage());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To artificially test this I used the following code...

     public boolean ingestAsTabular(Long datafile_id) {
+        if (true) {
+            throw (new RuntimeException("customMessage"));
+        }
         DataFile dataFile = fileService.find(datafile_id);

... to create this screenshot, which looks good to me:

Screen Shot 2023-05-26 at 2 47 48 PM

errorReport.setReport(BundleUtil.getStringFromBundle("file.ingest.saveFailed.detail.message") + ex.getMessage());
} else {
errorReport.setReport("Ingest succeeded, but failed to save the ingested tabular data in the database; no further information is available");
errorReport.setReport(BundleUtil.getStringFromBundle("file.ingest.saveFailed.message"));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For this one I used...

     public boolean ingestAsTabular(Long datafile_id) {
+        if (true) {
+            throw (new RuntimeException());
+        }
         DataFile dataFile = fileService.find(datafile_id);

... to get this screenshot, which also looks fine to me:

Screen Shot 2023-05-26 at 2 54 47 PM

@kcondon kcondon merged commit e2eb6d9 into IQSS:develop May 26, 2023
@pdurbin pdurbin added this to the 5.14 milestone May 26, 2023
@stevenferey stevenferey deleted the 9570-untranslated-error-ingest-message branch May 30, 2023 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature: Internationalization Size: 3 A percentage of a sprint. 2.1 hours.

Projects

Status: 🚀 Done (Recherche Data Gouv)

Development

Successfully merging this pull request may close these issues.

Untranslated error ingest message

5 participants