-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
It should be as simple as using the __ translation helper that is available on the Vue instance, i.e. change these lines:
nova-unlayer-field/resources/js/components/FormField.vue
Lines 29 to 34 in d965fdf
| data: () => ({ | |
| fullscreenButtonText: { | |
| on: '▶ Enter fullscreen', | |
| off: '✖︎ Exit fullscreen', | |
| }, | |
| }), |
to this:
on: '▶ ' + __('Enter fullscreen'),
off: '✖︎ ' + __('Exit fullscreen'),
Or maybe it's this.__('Enter fullscreen'), I'm not 100% sure.
Anyway, like this, a developer can define a translation in a translation file and if none is defined it will still display the English text.
A more elaborate alternative (might be overkill) is to make the text completely customizable, something that could be used like this when instantiating the field:
Unlayer::make('something')->withButtonLabels([
'enterFullscreen' => 'foo',
'exitFullscreen' => 'bar'
])
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request