server-status-project/server-status

Translation of service status not working properly?

Closed this issue · 4 comments

Not 100% sure if this is an actual issue or not, but it looks like it is at least for PHP 5.6 and 7.1 running on Centos 7 which I have tested on. Certain strings are not translated. You very kindly merged #63 which fixed the overall status translation, but I missed the translation of the service status. I guess this could also be the reason for #62...

The code change required for proper status translation is ceea671.

However, I see that for the demo site these sections are translated correctly, which makes me be a bit unsure.

This is what it looks like before d06f42d
image

This is what it looks like with d06f42d and ceea671.
image

Pryx commented

That looks weird as that change should not be required. I have an idea what could be causing it and will try to confirm later this evening and hopefully push a proper fix.

I found the reason why the default page fails to translate certain parts. The config.php is being included too late in the script. Commit 3eccbf5 fixes this issue.

On my Ubuntu 18.04 home server I also had to add the following to the setlocale section in order for any translation using _("...") to work. This might be the case for others as well..

putenv('LANGUAGE='.$_SESSION['locale'].'.UTF-8');

Pryx commented

@thnilsen this is fixed now, right?

We have fixes for this issue, but it is not in the master. This fix is part of the email subscription PR #71.
I will create a separate PR for this issue as the email subscription PR is being improved upon. This new PR should also cover #80 and #84 to the extent where the translations exists.