source => translated. */ public function build(): array { return array( 'Tap to interact' => __( 'Tap to interact', 'mapsemble' ), 'Filters' => __( 'Filters', 'mapsemble' ), 'More Filters' => __( 'More Filters', 'mapsemble' ), 'All Filters' => __( 'All Filters', 'mapsemble' ), 'Search' => __( 'Search', 'mapsemble' ), 'Sort by' => __( 'Sort by', 'mapsemble' ), 'No results found' => __( 'No results found', 'mapsemble' ), 'Try changing your search criteria or zooming out' => __( 'Try changing your search criteria or zooming out', 'mapsemble' ), 'Reset' => __( 'Reset', 'mapsemble' ), 'Erase' => __( 'Erase', 'mapsemble' ), 'Erase all' => __( 'Erase all', 'mapsemble' ), 'Clear' => __( 'Clear', 'mapsemble' ), 'Close' => __( 'Close', 'mapsemble' ), 'Apply' => __( 'Apply', 'mapsemble' ), 'Display' => __( 'Display', 'mapsemble' ), 'From' => __( 'From', 'mapsemble' ), 'To' => __( 'To', 'mapsemble' ), '1 item matches your search' => __( '1 item matches your search', 'mapsemble' ), /* translators: @count is replaced by the widget itself; keep it verbatim, it is not a PHP placeholder. */ '@count items match your search' => __( '@count items match your search', 'mapsemble' ), 'result' => __( 'result', 'mapsemble' ), 'results' => __( 'results', 'mapsemble' ), ); } /** * The table worth shipping to the widget, or null when there is none. * * Ships the *full* table once anything differs: untranslated entries * ride along as their English sources, which are identical to the * widget's own defaults, so a partial table (with unverified merge * semantics upstream) is never sent. * * @return array|null */ public function for_widget(): ?array { /** * Filters the widget translations table before the worth-shipping check. * * The seam for dynamic, Mapsemble-sourced strings and site overrides. * * @param array $table source => translated. */ $table = (array) apply_filters( 'mapsemble_widget_translations', $this->build() ); foreach ( $table as $source => $translated ) { if ( (string) $source !== (string) $translated ) { return $table; } } return null; } }