You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2023-05-05 18:28:32

Infinium
Member
Registered: 2023-04-13
Posts: 5

Help with locales!

What does this error mean?

PHP User Warning (512): Missing mandatory locale headers in "/var/www/glpi/locales/......."

I see this post in php-errors.log.

The error appeared after I edited in the special program the ".po" file by generating a ".mo" file. New files put in locales.

Offline

#2 2023-05-08 12:09:55

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,430
Website

Re: Help with locales!

The PO file is missing the required information about the language. At the start of the file, after the comments and before the first real translation should be an entry with a msgid of "" followed by several strings in a "Key: Value" format. The error you are getting appears if there are no "Language: " or "Plural-Forms: " lines.
The lines for example in en_GB.po:
"Language: en_GB\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

There should be other lines here, but those are the two that will trigger the error if they are missing.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#3 2023-05-11 19:32:04

Infinium
Member
Registered: 2023-04-13
Posts: 5

Re: Help with locales!

Hello!
Thanks for the answer!
I checked everything you wrote is in place.


msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-03 08:42+0000\n"
"PO-Revision-Date: 2023-02-22 11:01+0300\n"
"Last-Translator: Nick Pryazhnikov, 2022\n"
"Language-Team: Russian (Russia) (link)\n"
"Language: ru_RU\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : "
"n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
"X-Generator: Poedit 3.2.2\n"


the error was in this lines - extra quotes:
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 :
n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"

Last edited by Infinium (2023-07-17 19:40:56)

Offline

Board footer

Powered by FluxBB