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

Html formatter of report ant task only supports basic locales #289

Merged
merged 1 commit into from Mar 30, 2015

Conversation

Projects
None yet
2 participants
@marchof
Member

marchof commented Mar 30, 2015

The html elemet of the jacoco report ant task supports the 'locale' attribute. Unfortunately, there's currently no way to configure a Locale for a specific country, since ant seems to convert the String from the ant file to a Locale by invoking the constructor with one String argument, which only allows selection of language, but not of country.
To allow any Locale to be configured, you could e.g. invoke Locale#forLanguageTag.

To test this, you can use e.g. 'de' (German) and 'de-CH' (German (Switzerland)), which use different number formats, even though the language is the same.

@marchof

This comment has been minimized.

Show comment
Hide comment
@marchof

marchof Feb 27, 2015

Member

Thanks for this hint!

The only problem is that Locale#forLanguageTag is there since Java 7. JaCoCo is based on Java 5. Need to find another API to find the correct locale.

Member

marchof commented Feb 27, 2015

Thanks for this hint!

The only problem is that Locale#forLanguageTag is there since Java 7. JaCoCo is based on Java 5. Need to find another API to find the correct locale.

@barney2k7

This comment has been minimized.

Show comment
Hide comment
@barney2k7

barney2k7 Mar 2, 2015

Other libs that cannot use Java 7 (yet) usually rely on the '_' delimited format that Locale#toString produces. Unfortunately though, there's no parsing api for that. The parsing code however isn't that complicated, see e.g. https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/LocaleTypeDescriptor.java

barney2k7 commented Mar 2, 2015

Other libs that cannot use Java 7 (yet) usually rely on the '_' delimited format that Locale#toString produces. Unfortunately though, there's no parsing api for that. The parsing code however isn't that complicated, see e.g. https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/LocaleTypeDescriptor.java

marchof added a commit that referenced this pull request Mar 30, 2015

marchof added a commit that referenced this pull request Mar 30, 2015

Merge pull request #289 from jacoco/issue-289
Html formatter of report ant task only supports basic locales

@marchof marchof merged commit 19b4d4e into master Mar 30, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@marchof marchof deleted the issue-289 branch Mar 30, 2015

@marchof marchof added this to the 0.7.5 milestone Mar 30, 2015

@jacoco jacoco locked and limited conversation to collaborators Jan 11, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.