2 Configuration - Reference Documentation
Authors: Matouš Kučera
Version: 1.0
2 Configuration
There are few configuration options for the plugin:Name | Default | Description |
---|---|---|
grails.plugin.countrySelector.messageSource.useOnlyCustom | false | True if only custom i18n country settings should be used. See more in Countries Customization in i18n. |
2.1 Countries i18n
The plugin is dependent on i18n Grails plugin and allows to set all language/location properties needed for country selector. Therefore, simply changing the user locale can change the country selector behavior.It allows to set-up following properties for each country:- Country Code - Plugin uses ISO 3166-1 alpha-3 codes for countries but you can set your own. Country codes are the values returned when the user submit the country selector. They could be easily mapped to domain class property. Examples: GBR , DEU , etc.
- Country Name - It is the actual country name the user sees in autocomplete. Examples: United Kingdom , Germany , etc.
- Country Alternatives - Alternative strings which should be used for autocomplete. When the user starts typing an alternative he should receive a proper country name. Examples: GB Great Britain England UK Wales Scotland Northern Ireland for United Kingdom, DE Bundesrepublik Deutschland for Germany.
- Relevancy - The relevancy specifies the order of results in autocomplete. Country selector sorts the countries by their relevancy first (higher relevancy ~ higher position in autocomplete) and than alphabetically. Examples: United States relevancy 3.5 , United Kingdom relevancy 2.5
2.1.1 Countries Customization in i18n
The structure of i18n country properties is following:org.grails.plugin.countrySelector.CZE=Czech Republic org.grails.plugin.countrySelector.CZE.alternatives=CZ Česká Ceska org.grails.plugin.countrySelector.CZE.relevancy=1.5org.grails.plugin.countrySelector.DNK=Denmark org.grails.plugin.countrySelector.DNK.alternatives=DK Danmark org.grails.plugin.countrySelector.DNK.relevancy=1.5
grails.plugin.countrySelector.messageSource.useOnlyCustom = true