Load custom Webmin module titles automatically

After I was suggested to use UI translations on https://www.virtualmin.com/node/43072 and successfully doing so for all the occurrences of bandwidth, I am having troubles to get the module name "Bandwidth monitoring" replaced with a custom (translated) version automatically.

Putting bandwidth=Traffic Monitoring to /etc/webmin/webmin.descs solve the problem partially, because after that you have to go to Webmin > Webmin > Webmin Configuration > Module Titles and save it manually for the webmin.descs to take effect. And dealing with loads of Virtualmin servers we would like to automatize this process.

Could you please consult on how to load custom module titles (webmin.descs) and category names (webmin.catnames) automatically every time Webmin starts?

Status: 
Active

Comments

By the way, the Bandwidth Monitoring under System Settings does not change even after manually saving the Module Titles page in Webmin Configurations. I of course restarted Webmin and refreshed the browser window.

That's because that isn't a module title. Instead, to get what you want you need to create the file /etc/webmin/virtual-server/custom-lang containing newbw_title=Traffic Monitoring

The full list of strings that can be overridden in this way can be seen in /usr/libexec/webmin/virtual-server/lang/en

James, thanks, you replied to my comment, but not the post itself. So how can I load custom module and category titles automatically without going to Webmin Configuration page to save them manually?

I guess what you're asking is, if you edit webmin.descs manually, how can you make that take effect in Webmin?

If so, the answer is to just delete the file /etc/webmin/module.infos.cache

ls: cannot access /etc/webmin/module.infos.cache: No such file or directory

Sorry, it's /var/webmin/module.infos.cache

Well, for some reason removing /var/webmin/module.infos.cache works if you override, let's say, Webmin Configuration. However, removing that file has no effect over "Bandwidth Monitoring" - the UI still is showing the old value. And I am talking about the Module Title, not the string on UI pages - that one is translated ok.

By the "module title", do you mean the link to the module on left menu, or the title that appears on the right when you click on the module?

Link on the left menu. It has eventually changed, don't know when, but I know for sure that deleting the infos.cache file had no immediate effect on that link.

Oh, you may also need to delete /etc/webmin/virtual-server/links-cache/*