Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue due-dates are shown in English regardless of current language #5670

Closed
2 of 7 tasks
saltymouse opened this issue Jan 9, 2019 · 5 comments
Closed
2 of 7 tasks
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI

Comments

@saltymouse
Copy link

Description

Due-dates shown on the Issues page are shown in English regardless of the currently used UI language.
Switch to any non-English language (from the language switcher at the bottom of the page) and the dates are still shown in their English format (e.g. Jan 09, 2019)

Somewhat related: Milestone due-dates don't use the same date format as issues but are instead display in a more universal format (e.g. 2019-01-23), so it's more readable in any language, but perhaps they should be unified to use the same date display template?
...

Screenshots

Issues (Japanese UI) shows English language.
gitea-issue_date_language_test-ja

Milestones (Japanese UI) shows generic/unformatted date.
gitea-milestone_date_language_test-ja

@lunny lunny added the topic/ui Change the appearance of the Gitea UI label Jan 9, 2019
@stale
Copy link

stale bot commented Mar 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Mar 10, 2019
@lunny lunny added issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented and removed issue/stale labels Mar 16, 2019
@Ryuno-Ki
Copy link
Contributor

Ryuno-Ki commented Jun 5, 2022

The relevant template for issues is

{{if ne .DeadlineUnix 0}}
<span class="due-date tooltip" data-content="{{$.i18n.Tr "repo.issues.due_date"}}" data-position="right center">
<span{{if .IsOverdue}} class="overdue"{{end}}>
{{svg "octicon-calendar" 14 "mr-2"}}
{{.DeadlineUnix.FormatShort}}
</span>
</span>
{{end}}

and for milestones

<span {{if .IsOverdue}}class="overdue"{{end}}>{{.DeadlineString}}</span>

FormatShort is defined in

// FormatShort formats as short
func (ts TimeStamp) FormatShort() string {
return ts.Format("Jan 02, 2006")
}

and Deadline in

m.DeadlineString = m.DeadlineUnix.Format("2006-01-02")

I can see timeutil having localised version, but where would I pull the Location information from?

@wxiaoguang
Copy link
Contributor

Two choices:

  1. make user can set their timezone in their preference (setting) page.
  2. render date/time by frontend (JS)

Each of them has Pros/Cons.

A similar problem: #17760

@Ryuno-Ki
Copy link
Contributor

Are, the joy of internationalisation. Okay, your PR appears to be almost ready for merge. I'll put this on the backburner for now.

@yardenshoham
Copy link
Member

I fixed this

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

No branches or pull requests

5 participants