server-status-project/server-status

[BUG] Translations doesn't work as expected

mikolajstolarski94 opened this issue · 2 comments

Describe the bug
We created a dockerized instance of server-status as a POC. We're looking for open source satus page, that is fully translated into Polish.

But the only thing that's changing when we choose any language are time labels.

To Reproduce
Steps to reproduce the behavior:

  1. Use mysql:5.7, php , nginx:latest, php:7.4-fpm
  2. Use docker

Port 80 instead of custom doesn't change the problem

Expected behavior
All labels translated using pl-PL locale.

Screenshots
screen

Desktop (please complete the following information):

  • OS: Windows/Linux
  • Browser Chrome/Firefox

This is not really a bug, but a configuration issue on your server / docker instance. Server-Status uses the gettext() function in PHP and as such the server OS will need to have the languages you want to translate to installed at OS level. On Ubuntu this can be done using the command locale-gen. In order to add the Norwegian language I used locale-gen nb_NO.UTF-8. For Polish I guess it would be locale-gen pl_PL.UTF-8

Make sure you reload apache after a new locale has been added.

That's right. What is more, for future help for people who will face this problem:

If you're creating deployment using docker or k8s, and there are separate containers for ie. nginx and php-fpm you should install locales on php-fpm container. Default php-fpm docker project is based on Debian.

Edited by team. Reason: Invalid Code Snippet. Please refer to: #133