mdalves
mdalves

Hi @Mtt, is it possible to change the language of the date stamp of the posts from English to other language (as Brazilian Portuguese)? All of my blog (https://mdalves.com.br) is now in Portuguese but the dates, that are in English. Thank you.

|
Embed
Progress spinner
In reply to
Mtt
Mtt

@mdalves Yes. You'll need to add a custom theme on top of Tiny and modify a few files. All of this is possible within the Micro.blog dashboard.

Files to modify: - layouts/index.html (home page) - layouts/post/single.html (single posts) - layouts/_default/list.archivehtml.html (archive page) - layouts/_default/list.html (category pages) - layouts/_default/single.html (for individual reply pages) - layouts/section/replies.html (for reply page)

I believe dates are the only remaining front-facing thing that isn't already localized. It's on the roadmap, but I'm not there yet. I'll probably put dates in a partial so there's only one file to modify. But I'm still learning the best way to accomplish that stuff.

Having said all of that, there might be a way to script it somehow. For that, I'm going to ping @sod and @manton for their expertise.

|
Embed
Progress spinner
mdalves
mdalves

@Mtt Thank you; I will look at these files to understand how to define the language.

|
Embed
Progress spinner
sod
sod

@Mtt Hugo's time.Format (aliased as dateFormat) has built-in support for localization. When a theme uses that function to format dates, localization happens automatically depending on the content language. There's currently no easy way to control this in the Micro.blog GUI, but it's possible to set defaultContentLanguage in config.json via a custom theme. @manton @mdalves

|
Embed
Progress spinner
mdalves
mdalves

@sod @mtt Thank you all. I was not able to define the language but I updated all the files to set date format as "dd/mm/yyyy" and this is OK for me.

|
Embed
Progress spinner