City in your native language

Created on 3 October 2021, about 3 years ago
Updated 28 November 2024, 24 days ago

Hi! Please tell me how I can display the name of the city in my native language. I have it displayed in English, and I need it in Russian. Here is the code I use:

class CustomBlock extends BlockBase {
  /**
   * {@inheritdoc}
   */
  public function build() {
	  /** @var \Drupal\smart_ip\SmartIpLocation $location */
	$ip = file_get_contents('https://api.ipify.org');
    $location = SmartIp::query($ip);
    
    return array(
      '#type' => 'markup',
      '#markup' => $location['city'],
    );
  }
}
💬 Support request
Status

Postponed: needs info

Version

4.2

Component

Documentation

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • heddn Nicaragua

    Drupal 8 & 9 are no longer supported. This version of the module this was opened against only supports these earlier versions of Drupal. If this is still something you want addressed in the current 5.x version of the module, please update and provide some next steps.

Production build 0.71.5 2024