Skip to content

Please make the "Enter fullscreen", "Exit fullscreen" text translatable #3

@BenjaminBrandtner

Description

@BenjaminBrandtner

It should be as simple as using the __ translation helper that is available on the Vue instance, i.e. change these lines:

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 request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions