diff --git a/localization.md b/localization.md index 03125e743b..66a9d5725a 100644 --- a/localization.md +++ b/localization.md @@ -226,6 +226,23 @@ public function boot(): void } ``` + +#### Tag Replacement + +You may define custom tags which will be replaced within your translation strings: + + echo __( + 'The documentation contains all you need to know!', + [ + 'docs-link' => fn (string $children) => "$children" + ] + ); + +If you are using the [Blade templating engine](/docs/{{version}}/blade) then you will need to echo them using the unescaped `{!! !!}` echo syntax to allow your tags to be rendered correctly. + +> [!WARNING] +> Tag replacements are not the same as XML/HTML tags and do not accept attributes. + ### Pluralization