Is there any way to change the used language in the above mentioned component dropdown?
adding lang="DE" for german language did not work:
<div class="p-field p-col-12 p-md-6">
<h7>Festnetz</h7>
<pe:inputPhone id="festnetz" label="Hallo" lang="DE"
initialCountry="#{kontakt.countryIsoFestnetz}"
value="#{kontakt.festnetz}" formatOnDisplay="true">
<p:ajax event="countrySelect"
listener="#{kontakt.onCountrySelectFestnetz}" />
</pe:inputPhone>
</div>
Since PrimeFaces Extensions 12.0.2 you can use the localizedCountries to do so. You can either supply a Map<String, String> containing the ISO 2 abbreviation (lower case) (key), and the name (value):
private Map<String, String> localizedCountries;
@PostConstruct
protected void init() {
localizedCountries = new HashMap<>();
localizedCountries.put("nl", "Nederland");
localizedCountries.put("be", "België");
localizedCountries.put("de", "Duitsland");
}
// Add getter
<pe:inputPhone onlyCountries="nl,be,de"
localizedCountries="#{bean.localizedCountries}"/>
or a JSON string:
<pe:inputPhone onlyCountries="nl,be,de"
localizedCountries="{'nl':'Nederland','be':'België','de':'Duitsland'}"/>
See also:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With