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

Not localised uptime days,hours,mins strings #592

Open
ostasevych opened this issue Apr 25, 2024 · 0 comments
Open

Not localised uptime days,hours,mins strings #592

ostasevych opened this issue Apr 25, 2024 · 0 comments

Comments

@ostasevych
Copy link

The uptime info contains not localised strings "days", "hours", "minutes", "seconds"
image

It comes from this function:

private function formatUptime(int $uptime): string {
                if ($uptime === -1) {
                        return 'Unknown';
                }

                try {
                        $boot = new \DateTime($uptime . ' seconds ago');
                } catch (\Exception $e) {
                        return 'Unknown';
                }

                $interval = $boot->diff(new \DateTime());
                if ($interval->days > 0) {
                        return $interval->format('%a days, %h hours, %i minutes, %s seconds');
                }
                return $interval->format('%h hours, %i minutes, %s seconds');
        }

So, localisation tags are to be added there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants