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

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

Merged
merged 1 commit into from
Mar 30, 2015

Conversation

marchof
Copy link
Member

@marchof 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
Copy link
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
Copy link
Author

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
Html formatter of report ant task only supports basic locales
@marchof marchof merged commit 19b4d4e into master Mar 30, 2015
@marchof marchof deleted the issue-289 branch March 30, 2015 21:42
@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants