-
Notifications
You must be signed in to change notification settings - Fork 2
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
Language support #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I had a couple questions and an offline request to bump the version number.
String url =href.substring("file:".length()); // some calculation from its parameters | ||
InputStream is = this.getClass().getResourceAsStream(url); | ||
return new StreamSource(is); | ||
int index = href.lastIndexOf("/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the path? I guess it works now because the java package path and the resources path are the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and also It did not work with the path. In any case "ddi-to-fo.xsl" also does not use path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird - I thought I had the i18n part (without the tika test) working at one point.
<groupId>org.apache.tika</groupId> | ||
<artifactId>tika-langdetect-optimaize</artifactId> | ||
<version>2.9.2</version> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you looked at issue #3 - is fop still not included? Are the tika classes? (If so - then we can close that issue when this merges).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fop is included. I did not have problems with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it - guessing it's a build command problem - I made a note in the issue #3.
I changed version to 1.1.0 |
Can we publish it to Maven Central? And update the TBD at https://github.com/gdcc/dataverse-exporters ? |
I was able to test this in English and it worked fine, so I'll go ahead and merge. |
Language support was added. The code is checking xml:lang (Metadatalanguage) property in xml codebook and if it is present, it selects the language for pdf codebook based on it. If inc language file does not exists than it produces English pdf codebook.
If property xml:lang does not exist then code tries to guess the language of dataset based on Title or Description. It uses Apache Tika language detection. If it detects language with high probability then this language is used for generating pdf codebook, in all other cases English is used.