server-status-project / server-status

Simple, modern looking server status page with administration and some nice features, that can run even on shared webhosting
https://demo.status.sajdl.com/
Apache License 2.0
398 stars 88 forks source link

[BUG] Translations doesn't work as expected #132

Closed mikolajstolarski94 closed 3 years ago

mikolajstolarski94 commented 3 years ago

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):

thnilsen commented 3 years ago

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 nbNO.UTF-8. For Polish I guess it would be _locale-gen plPL.UTF-8

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

mikolajstolarski94 commented 3 years ago

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