| 1 |
<?php |
| 2 |
|
| 3 |
namespace BitCode\BitForm\Core\Util\Translation\Contract; |
| 4 |
|
| 5 |
/** |
| 6 |
* Optional half of the provider contract, for plugins that keep their own |
| 7 |
* string store (WPML, Polylang). HTML-layer plugins discover strings from the |
| 8 |
* rendered page and implement only TranslationProviderInterface. |
| 9 |
* |
| 10 |
* TranslationManager checks `instanceof` before calling onAdminInit(). |
| 11 |
*/ |
| 12 |
interface StringRegistrationProviderInterface |
| 13 |
{ |
| 14 |
/** |
| 15 |
* Admin context: attach registration hooks (form save, translation screens). |
| 16 |
*/ |
| 17 |
public function onAdminInit(); |
| 18 |
|
| 19 |
/** |
| 20 |
* Push [contextKey => sourceString] for one form into the plugin's store. |
| 21 |
* |
| 22 |
* @param mixed $formId |
| 23 |
* @param array<string,string> $contextStrings |
| 24 |
*/ |
| 25 |
public function registerStrings($formId, array $contextStrings); |
| 26 |
} |
| 27 |
|