Translations::translate

Advertisement

Syntax Syntax

Translations::translate( string $singular, string $context = null )

Parameters Parameters

$singular

(string) (Required)

$context

(string) (Optional)

Default value: null

Return Return

(string)

Source Source

File: wp-includes/pomo/translations.php

		function translate( $singular, $context = null ) {
			$entry      = new Translation_Entry(
				array(
					'singular' => $singular,
					'context'  => $context,
				)
			);
			$translated = $this->translate_entry( $entry );
			return ( $translated && ! empty( $translated->translations ) ) ? $translated->translations[0] : $singular;
		}

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.