• The current Plugin as is dose not support translating the city names to multiple languages.
    I made the following changes to fix that:
    1- When preparing the cities:
    function my_cities( $cities ) {
    $cities[‘XX’] = array(
    ‘YYY’ => array(
    [‘City in English’] => __(‘City in English’,’city_names’),
    [‘Another City in English’] => __(‘Another City in English’,’city_names’)
    ),
    ‘ZZZ’ => array(
    [‘City3 in English’] => __(‘City3 in English’,’city_names’),
    [‘City4 in English’] => __(‘City4 in English’,’city_names’)
    )
    );
    return $cities;
    }
    2- in the php:
    foreach ( $this->dropdown_cities as $city_code => $city_name ) {
    $field .= ‘<option value=”‘ . esc_attr( $city_code ) . ‘” ‘.selected( $value, $city_code, false ) . ‘>’ . $city_name .'</option>’;
    }

    1- in the java:
    options = options + ‘<option value=”‘ + index + ‘”>’ + cityName + ‘</option>’;

  • The topic ‘Fix for Translating City names’ is closed to new replies.