plugin-templates icon indicating copy to clipboard operation
plugin-templates copied to clipboard

Localized month and days names

Open zapateo opened this issue 2 years ago • 3 comments

This template:

{{#custom_datetime}}ddd D MMM YYYY{{/custom_datetime}}

renders to:

Fri 28 Jan 2022

but I would like to get the month and day names localized in my language, for example italian:

Ven 28 Gen 2022

Is there any way to get this?

(ps. thanks for this awesome extension).

zapateo avatar Jan 28 '22 15:01 zapateo

Not sure, @CalebJohn is there a way to use joplin's i18n inside plugins?

nishantwrp avatar Jan 28 '22 16:01 nishantwrp

Not sure, @CalebJohn is there a way to use joplin's i18n inside plugins?

It's not possible to access Joplin's il8n inside plugins, but you don't need it for this anyways. You only need the current locale which you can access with joplin.settings.globalValue('locale').

CalebJohn avatar Jan 28 '22 17:01 CalebJohn

~~One related question: Why does when using {{ bowm }} and selecting Date format 30.01.2017 but Language English UK) the date get rendered as 30/07/2017 and not as the specifically selected format? (Or is this a current bug?)~~

~~Would be a nice enhancement to rely on this value instead the language setting...~~

Sorry for the noise. Joplin requires a restart and then it works

q-wertz avatar Sep 07 '23 13:09 q-wertz