xcarpentier / react-native-country-picker-modal

🇦🇶 Country picker provides a modal allowing a user to select a country from a list. It display a flag next to each country name.
https://reactnative.gallery/xcarpentier/country-picker
MIT License
1.08k stars 802 forks source link

withCountryNameButton is not work with translation #273

Closed Helongzhou closed 4 years ago

Helongzhou commented 4 years ago
selectCountry(country) {
    this.setState({countryCode: country.cca2});
    this.setState({country});
  }

  render() {
    const {countryCode, country} = this.state;
    return (
      <View style={styles.container}>
        <CountryPicker
          countryCode={countryCode}
          withFilter
          withFlag
          withCountryNameButton
          withAlphaFilter
          onSelect={this.selectCountry.bind(this)}
          translation="eng">
          <View />
        </CountryPicker>
        <Text style={styles.instructions}>Press on the flag to open modal</Text>
        {country !== null && (
          <Text style={styles.data}>{JSON.stringify(country, null, 2)}</Text>
        )}
      </View>
    );
  }

withCountryNameButton not work because i used translation. if i remove ' translation="eng"',it work.

xcarpentier commented 4 years ago

We don't have 'eng' translation. English is the 'common' translation.