$package Package descriptor: kind, name, title, edit_link. * @since 2.11.0 * @return void */ public function start_package( array $package ): void; /** * Finish registering a string package, removing any strings that were not * re-registered since {@see start_package()} (e.g. fields deleted from a form). * * @param array $package Package descriptor. * @since 2.11.0 * @return void */ public function finish_package( array $package ): void; /** * Register a single string within a package. * * @param array $package Package descriptor. * @param string $name Stable string identifier within the package. * @param string $value Original string value. * @param string $title Human-readable label shown in the Translation Editor. * @param string $type Editor field type: LINE, AREA or VISUAL. * @since 2.11.0 * @return void */ public function register_package_string( array $package, string $name, string $value, string $title = '', string $type = 'LINE' ): void; /** * Translate a single package string for the current language. * * @param array $package Package descriptor. * @param string $name Stable string identifier within the package. * @param string $value Original value (fallback when untranslated). * @since 2.11.0 * @return string Translated value, or the original when no translation exists. */ public function translate_package_string( array $package, string $name, string $value ): string; /* * NOTE: delete_package( array $package ): void is deliberately NOT declared here. * * This interface is a public extension point — Multilingual_Manager::resolve_provider() * accepts any object via the `srfm_multilingual_provider` filter (@since 2.11.0) and * instanceof-checks it. Adding a bodyless method to a shipped interface is a * fatal-error BC break: a third-party provider written against 2.11.0-2.12.2 would * fail at class-declaration time on update, producing a white screen rather than a * degraded feature. Guarding the call site does not help, because the fatal happens * when the implementor's class is declared, not when the method is called. * * Both first-party providers implement delete_package(), and String_Collector * feature-detects it before calling. If it is ever promoted into this contract, that * must be a major release with a migration note for custom providers. */ }