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 2025-03-18 14:46:31

lordbat
Member
From: Spain
Registered: 2016-02-12
Posts: 191

[Solved]Adding custom locales without overriding the existing ones

Hi, is possible to add new custom translation locales without overriding the existing ones? for example en_GB is core locale but i want another custom like en_CUSTOM?  o something similar?


Regards

**Update**

Even following the override GLPI locales followed from the docs https://glpi-user-documentation.readthe … cales.html

I cant get changes (I clean cache by CLI, Reset Translation Cache and deleting files from _cache folder) and dont get even the example change (msgid "Login").

Last edited by lordbat (2025-03-20 16:40:09)


You can mark this thread as [Solved] in the subject of your thread. (This is only available edit of the first post.) It is good for users who help others to quickly see which post is still open.
############################################################

Offline

#2 2025-03-19 11:04:02

cconard96
Moderator
Registered: 2018-07-31
Posts: 3,231
Website

Re: [Solved]Adding custom locales without overriding the existing ones

You cannot add new languages, only override the translations of existing ones.


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 2025-03-20 09:08:16

lordbat
Member
From: Spain
Registered: 2016-02-12
Posts: 191

Re: [Solved]Adding custom locales without overriding the existing ones

cconard96 wrote:

You cannot add new languages, only override the translations of existing ones.

Thanks cconard96 for the response but anyway when i try to override base on the docs, i cant apply theses changes.

Using the example:

# Override PO file
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-13 10:43+0200\n"
"PO-Revision-Date: 2019-04-13 10:43+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: en_GB\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

msgid "Login"
msgstr "Login from local gettext"

i cant see this change and another point is the source sentences is not there ( locales/glpi.pot ) or at least in glpi 10.0.16 and 10.0.18

Regards


You can mark this thread as [Solved] in the subject of your thread. (This is only available edit of the first post.) It is good for users who help others to quickly see which post is still open.
############################################################

Offline

#4 2025-03-20 12:27:49

cconard96
Moderator
Registered: 2018-07-31
Posts: 3,231
Website

Re: [Solved]Adding custom locales without overriding the existing ones

The PO file is a source, while the MO file is the actual compiled localization. You will need to use a tool like "msgfmt" to compile the PO file and then your custom locales should be "files/_locales/core/en_GB.mo". Finally, clear the translation cache when in debug mode under Setup > General > Performance tab.


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

#5 2025-03-20 16:39:24

lordbat
Member
From: Spain
Registered: 2016-02-12
Posts: 191

Re: [Solved]Adding custom locales without overriding the existing ones

cconard96 wrote:

The PO file is a source, while the MO file is the actual compiled localization. You will need to use a tool like "msgfmt" to compile the PO file and then your custom locales should be "files/_locales/core/en_GB.mo". Finally, clear the translation cache when in debug mode under Setup > General > Performance tab.


Ohhhh!.. I miss to rename the new .po with the same origin lang name.  my file wast like the docs (filename.po). Now works like a charm!!

Thanks cconard96 for the help and time!!


You can mark this thread as [Solved] in the subject of your thread. (This is only available edit of the first post.) It is good for users who help others to quickly see which post is still open.
############################################################

Offline

Board footer

Powered by FluxBB