Question: Is possible to change default language

ddangel0

New Member
Aug 21, 2020
9
1
1
47
Hello, I wanted to know if what I need to do is possible and in what way it could be done.
I am about to put into production the quarantine of emails with tickets

The problem is that we need that by default when the user opens the link with the ticket for the first time, it appears in Spanish, so that the user does not have to go to select the language, that is, avoid that step.

Since I didn't find any settings to force it, try modifying the file:

/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js

On the line :

return Proxmox.Utils.defaultText + '(English)';

by

return Proxmox.Utils.defaultText + '(Spanish)';

In this way when I open the https://server:8006/quarantine I see that Spanish is selected, but the change of language does not apply, everything is still in English

As I am not a programmer I don't know how to continue, if someone could do this and can tell me how, I really appreciate it.
I'm using:

proxmox-mailgateway: 6.2-1 (API: 6.2-5/05a7829e, running kernel: 4.9.0-3-amd64)
pmg-api: 6.2-5
pmg-gui: 2.2-2
pve-kernel-5.4: 6.2-4
pve-kernel-helper: 6.2-4
pve-kernel-5.4.44-2-pve: 5.4.44-2
clamav-daemon: 0.102.4+dfsg-0+deb10u1
libarchive-perl: 3.3.3-1
libjs-extjs: 6.0.1-10
libjs-framework7: 4.4.7-1
libpve-apiclient-perl: 3.0-3
libpve-common-perl: 6.1-3
libpve-http-server-perl: 3.0-6
libxdgmime-perl: 0.01-5
pmg-docs: 6.2-2
pmg-log-tracker: 2.1.6-1
postgresql-11: 11.7-0+deb10u1
proxmox-mini-journalreader: 1.1-1
proxmox-spamassassin: 3.4.4-2
proxmox-widget-toolkit: 2.2-8
pve-firmware: 3.1-1
pve-xtermjs: 4.3.0-1
 
The problem is that we need that by default when the user opens the link with the ticket for the first time, it appears in Spanish, so that the user does not have to go to select the language, that is, avoid that step.
Currently this is not possible - however the setting is stored in the browser per user - so your users would (in most cases) only need to select the language once

Anyways since this is the 4th request for something like this in the past 4 weeks - would you mind creating an enhancement request at our bugzilla?
https://bugzilla.proxmox.com

Thanks!
 
Currently this is not possible - however the setting is stored in the browser per user - so your users would (in most cases) only need to select the language once

Anyways since this is the 4th request for something like this in the past 4 weeks - would you mind creating an enhancement request at our bugzilla?
https://bugzilla.proxmox.com

Thanks!


I found a way to do it for whoever needs to do it,

edit the file: /usr/share/javascript/pmg-gui/pmg-index.html.tt


Replace the line:
Code:
<script type='text/javascript'> function gettext(buf) { return buf; } </script>

by the line:
Code:
<script type='text/javascript' src='/pve2/locale/pmg-lang-es.js'></script>

# Being pmg-lang-es.js the language for Spanish, changing depends on the language you need

run:

#: systemctl restart pmgproxy.service
 
  • Like
Reactions: EDSON MARIO
In PBS there is an language option in the webgui. But i can't find it on PVE :confused:. Guys am I blind or is there the time only under PBS?
 
By default, the pve-manager source code which manages the language is actually:

HTML:
<script type='text/javascript'>function gettext(buf) { return buf; }</script>

If I change the default language to French when connecting, it becomes :

HTML:
<script type='text/javascript' src='/pve2/locale/pve-lang-fr.js?ver=8.1.4'></script>

This forum allowed me to discover the pve-manager template :
/usr/share/pve-manager/index.html.tpl

here is a snippet of the code. This code manages the use of the API translation file.
I notice the lang variable in [% lang %] is replaced by its value when the index page loads.
HTML:
[% IF langfile %]
<script type='text/javascript' src='/pve2/locale/pve-lang-[% lang %].js?ver=[% version %]'></script>
[%- ELSE %]
<script type='text/javascript'>function gettext(buf) { return buf; }</script>
[% END %]

In fact the variable [% lang %] is managed by /etc/pve/datacenter.cfg configuration file.

code_language.shell:
# nano /etc/pve/datacenter.cfg

I added the keyboard variable and that of my native language variable:
keyboard: fr
language: fr

I save the file then restart the server
code_language.shell:
# systemctl restart pveproxy.service

the parameter : language: fr allows you to define the variable [% lang % ] which previously was not defined.

I invite you to take a look at the configuration file documentation datacenter.cfg
https://pve.proxmox.com/wiki/Manual:_datacenter.cfg

max_workers: <integer> (1 - N)
For example, the following option : ha: shutdown_policy=<enum> defines how virtual machines should shut down when the proxmox server is turned off, etc.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!