Language selector.

Signature

wp_dropdown_languages( $args = array() )
args
 (string|array) Optional. Array or string of arguments for outputting the language selector.
Default: array()

Return

(string) HTML content

Source

function wp_dropdown_languages( $args = array() ) {

	$parsed_args = wp_parse_args( $args, array(
		'id'           => 'locale',
		'name'         => 'locale',
		'languages'    => array(),
		'translations' => array(),
		'selected'     => '',
		'echo'         => 1,
		'show_available_translations' => true,
		'show_option_site_default'    => false,
	) );

	// Bail if no ID or no name.
	if ( ! $parsed_args['id'] || ! $parsed_args['name'] ) {
		return;
	}

	// English (United States) uses an empty string for the value attribute.
	if ( 'en_US' === $parsed_args['selected'] ) {
99 more lines...
WP Trac GitHub

Link here