You are not logged in.
Pages: 1
Hello we want to rename the Menu Point Devices to something else. I read about the .po but could only manage to find myself to /usr/share/locale/de/LC_MESSAGES and I have not found out how to change that point yet.
If anybody has experience with that please feel free to help me
Offline
The GLPI translations are in the "locales" folder inside GLPI.
Ideally, you would be using the Rename GLPI Strings plugin (available through GLPI-Network) to change these though.
https://plugins.glpi-project.org/#/plug … leoverride
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
I've had an experience with changing GLPI interface strings.
(I do not give any warranty but it worked for me):
0. Make a backup of both .po and .mo files with your locale ../glpi/locales in case something wrong happens;
1. Find a .po file with your language in server folder;
2. Open in any text editor and find string that you want to modify (by Ctrl+F) and change it to desired value;
3. Go to any .po to .mo converter (i.e. po2mo net) and get your .mo file based on .po;
4. Move both .po and .mo files into ../glpi/locales
5. Go to the GLPI panel, turn on debug mode;
6. Go to Setup > General > Performance > Reset Translation Cache
7. Now you may see new strings on your interface
Downside: after updating to new version I had to do it all again
Offline
I also named them alike (i.e. de_DE.po and de_DE.mo)
Offline
could it be possible to create a script to automate this task ? or a crontab
Offline
I think it is technically possible.
In script you may write some code to read contents of files, modify them, it is up to you to choose your scripting language.
I know in Python there a polib library that allows you to convert .po to .mo. Combine it with reading file and modifying its values in your code
Here's an example (feel free to fix me. Also would recommend firstly running in test environment):
import polib
import os
def modify_glpi_strings(language_code, original_string, modified_string):
po_file_path = f'../glpi/locales/{language_code}.po'
po = polib.pofile(po_file_path)
for entry in po:
if original_string in entry.msgid:
entry.msgstr = modified_string
po.save()
mo_file_path = f'../glpi/locales/{language_code}.mo'
po.save_as_mofile(mo_file_path)
return mo_file_path
language_code = 'ru_RU'
original_string = 'Original Value'
modified_string = 'Modified Value'
mo_file_path = modify_glpi_strings(language_code, original_string, modified_string)
print(f'Modified .mo file saved at: {mo_file_path}')
Then just add Python script to Cron scheduler. Or Docker.
on your server open cron
crontab -e
Add line to run everyday at 17:30:
30 17 * * * /usr/bin/python3 /path/to/glpi_string_modifier.py
However I would recommend just using plugin that moderator suggested above
Offline
Pages: 1