Date format does not get reflected when changing the post language

未关闭
#530 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
go
领域
localization

调研方向

从 posts.go 大约第 1113 行开始,这里会根据帖子的语言选择日期格式,并按照列出的编辑、保存和重新加载步骤重现该行为。追踪本地化格式为何会短暂出现或被替换,然后验证将帖子改为非英语语言后,其本地化日期格式是否能始终一致地显示。

由索引模型根据 Issue 内容生成。

描述

enhancement
Describe the bug

I was looking into options on how to change the date formats that show up on the home page as well as individual post pages.

I was aiming for a more international format e.g. "2022-01-18", so I tried changing the language to Lithuanian ("lietuvių kalba"), however it had no effect on the format.

When testing Portuguese I've noticed that when refreshing the page it changed the format for a short flash, however, after several milliseconds it fell back to the english version.

This part of the code seems to indicate that it should take the format based on the language.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to edit an existing post
  2. Change the language to some else than english e.g. portuguese
  3. Save the changes
  4. Reload the post
Expected behavior

Changing the post language would change the format of how the date is being displayed. Ideally there would be a way to change the default language per blog, but that's a bonus.

Application configuration
  • Single mode or Multi-user mode? Single
  • Database? mysql
  • Open registration? no
  • Federation enabled? yes

Version or last commit: v0.13.1

主要语言
Go
星标
5.3k
派生
413
平均合并
3 天 5 小时
30 天内合并 PR
4

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

writefreely/writefreely 的其他 Issue

查看 writefreely/writefreely 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。