FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Localizing Dates in Go Templates: A Deep Dive
NewsWeb Development

Localizing Dates in Go Templates: A Deep Dive

via Dev.toGerardo Andrés Ruiz Castillo1mo ago

Introduction In the devlog-ist/landing project, we recently tackled an interesting challenge: ensuring post publication dates were correctly localized across all portfolio themes. This involved making sure that month names and other date elements respected the application's locale, as set by the SetLocale middleware. The fix centered around using translatedFormat() instead of format() within the Go templates. The Problem: Inconsistent Date Formatting The initial implementation used Go's format() function to display post dates. While this worked fine for the default locale, it failed to adapt when users switched to different languages. For instance, month names would remain in English even when the application was set to display in French or Spanish. The Solution: translatedFormat() The key to solving this was the translatedFormat() function. This function, unlike format() , is locale-aware. It retrieves the translated month names and other date elements from the application's localizat

Continue reading on Dev.to

Opens in a new tab

Read Full Article
20 views

Related Articles

Dependency Injection in iOS
News

Dependency Injection in iOS

Medium Programming • 1d ago

News

zxing Decoder Online|2026

Medium Programming • 1d ago

Don't ignore your desktop PC's empty M.2 slots - they're more useful than you think
News

Don't ignore your desktop PC's empty M.2 slots - they're more useful than you think

ZDNet • 1d ago

My favorite color e-reader is still $80 off, but hurry if you want to save
News

My favorite color e-reader is still $80 off, but hurry if you want to save

ZDNet • 1d ago

Cosine Similarity vs Dot Product in Attention Mechanisms
News

Cosine Similarity vs Dot Product in Attention Mechanisms

Dev.to • 1d ago

Discover More Articles