= I18n Country Subdivisions
image:https://github.com/mihxil/i18n-subdivisions/actions/workflows/maven.yml/badge.svg?[Build Status,link=https://github.com/mihxil/i18n-subdivisions/actions/workflows/maven.yml]
image:https://img.shields.io/maven-central/v/org.meeuw.i18n/i18n-subdivision-enums.svg?label=Maven%20Central[Maven Central,link=https://search.maven.org/search?q=g:%22org.meeuw.i18n%22]
image:https://img.shields.io/nexus/s/https/oss.sonatype.org/org.meeuw.i18n/i18n-subdivision-enums.svg[snapshots,link=https://oss.sonatype.org/content/repositories/snapshots/org/meeuw/i18n/i18n-subdivision-enums/]
// image:https://codecov.io/gh/mihxil/i18n-subdivisions/branch/main/graph/badge.svg[codecov,link=https://codecov.io/gh/mihxil/i18n-subdivisions]
image:https://www.javadoc.io/badge/org.meeuw.i18n/i18n-subdivision-enums.svg?color=blue[javadoc,link=https://www.javadoc.io/doc/org.meeuw.i18n/i18n-subdivision-enums]
== Overview
Package to support internationalization, specifically the Subdivision (provinces/states/region)
defined in ISO 3166-2.
It depends on the neovisionaries i18n (nv-i18n) package for defining all the CountryCodes used.
This is forked from https://github.com/tobias-/i18n-subdivisions which doesn't seem to be maintained. I changed the coordinates and package and am maintaining it myself now.
The author is well aware that there are bound to be problems in the data set. If nothing else, the data changes over time, so please submit issues when something is wrong (preferably with a verifiably link to the correct data).
While the information on what kind of subdivision it is (region, island, state, province, city etc), they are too many different kinds for them to be readily usable and thus they are not available.
== License
Apache License, Version 2.0
== Download
[source,sh]
git clone https://github.com/mihxil/i18n-subdivisions.git
All code is generated by the groovy script src/build/groovy/generateSubdivisions.groovy
from the html files in src/build/resources/
.
== Building
[source,sh]
mvn clean install -Pdownload-subdivisions
== Releasing
[source,sh]
mvn release:prepare release:perform -Pdownload-subdivisions
== Example
List all the subdivision codes available for a specific country.
[source,java]
for (CountrySubdivisionCode code : SubdivisionFactory.getSubdivisions(CountryCode.BE)) {
System.out.format("[%s] %s\n", code, code.getName());
}
This is wrapped also in https://github.com/mihxil/i18n-regions#subdivisions-of-countries[i18n-regions], which would make every enum defined in this project available as a more generic 'Region' object.
== Maven
[source,xml]
org.meeuw.i18n
i18n-subdivision-enums
0.3
----
== Gradle
[source,gradle]
dependencies {
compile 'org.meeuw:i18n-subdivision-enums:0.3'
}
== See Also
== TODO
- Verify with another source of the codes
- If anyone wants them, include subdivision types in the enum