Translations::add_entry() WordPress Method
The Translations::add_entry() method inserts a new translation into the WordPress database. The method takes three arguments: the original string, the translated string, and the domain. The original string and the translated string can be either a single string or an array of strings. The domain is the text domain for the translation.
Translations::add_entry( array|Translation_Entry $entry ) #
Add entry to the PO structure
Parameters
- $entry
(array|Translation_Entry)(Required)
Return
(bool) true on success, false if the entry doesn't have a key
Source
File: wp-includes/pomo/translations.php
public function add_entry( $entry ) { if ( is_array( $entry ) ) { $entry = new Translation_Entry( $entry ); } $key = $entry->key(); if ( false === $key ) { return false; } $this->entries[ $key ] = &$entry; return true; }
Expand full source codeCollapse full source codeView on TracView on GitHub