Submitted by yngens on Wed, 01/06/2016 - 18:35
Per discussion on https://www.virtualmin.com/node/31006, I've copied the /usr/libexec/webmin/authentic-theme/lang/en
to /usr/libexec/webmin/authentic-theme/custom-lang
, edited some strings, however unfortunately couldn't get them reflected on UI even after restarting Webmin. Looking at the following code, where the string "Webmin" is hardcoded in HTML:
<label for="open_webmin">
<i class="wbm-webmin wbm-sm"></i><span>Webmin</span></label>
or hardcoded "Create Virtual Server" in
<li class="sub_active">
<a target="page" class="navigation_module_trigger" data-href="/virtual-server/domain_form.cgi?generic=1&gparent="><i class="fa fa-fw fa-plus-square-o"></i> <span>Create Virtual Server</span></a>
<span class="current-large"></span></li>
I wonder if Authentic Theme can work with custom-lang files at all?
Status:
Closed (fixed)
Comments
Submitted by yngens on Wed, 01/06/2016 - 18:49 Comment #1
Two new findings:
Moving the /usr/libexec/webmin/authentic-theme/custom-lang file to /etc/webmin/authentic-theme and restarting Webmin didn't help.
Editing the
/usr/libexec/webmin/authentic-theme/lang/en
file and replacingleft_virtualmin_create=Create Virtual Server
withleft_virtualmin_create=Create Domain
also didn't work.I know that editing this file directly is not recommended, because the right way is to create custom-lang file to override strings in "en" file, however I just wanted to test as modifying this file directly usually works. This means Authentic Theme doesn't take the presence of language files into account at all.
Submitted by JamieCameron on Wed, 01/06/2016 - 19:58 Comment #2
The custom-lang file can only override strings that aren't hard-coded ... in the perl code, they look like $text{'messagename'}
The real bug here is that authentic theme has hard-coded strings. I'll ask the author about this.
The
custom-lang
file actually works.Reading the provided link above (Change "Virtual Server" to "Domain") I tested it as it's written. However, I don't understand what is the point of copying files in the
lang
directory. It wasn't necessary in my case. All I needed is to createcustom-lang
file inetc
of a module or theme to make things work.To override
Create Virtual Server
you would need to put to/etc/webmin/virtual-server/custom-lang
the following:left_generic=Create Domains
The stray variable
left_virtualmin_create
in my theme will be removed as it does nothing.The piece of HTML code that you showed will always show a string, as it's processed on the server, thus will always look
hardcoded
to the browser.There some hardcoded strings, like Webmin, Virtualmin, Cloudmin and some more.. It will be fixed in the next release.
Jamie, I find this a bit inconvenient. Can you write couple more line of code (if possible by design), so that theme's
custom_lang
file could contain all possible strings from all modules that a user wants to override.I realize that there could be collisions, thus using module name would be required. For example, instead of making user to put custom strings to
/etc/webmin/virtual-server/custom_lang
, the user could put all in the/etc/authentic-theme/custom_lang
with the following format:virtual-server: left_generic=Create Domains
Doing so, will make things organized rather than having separate file in each directory.
Submitted by yngens on Thu, 08/17/2017 - 16:20 Comment #5
I didn't know the
/usr/libexec/webmin/virtual-server/lang/en
changed a lot since we copied it initially and replaced all the strings we needed to replace:-rw-r--r-- 1 root root 358155 Jan 7 16:48 custom-lang.new
-rw-r--r-- 1 root root 327599 Jan 7 16:46 custom-lang.old
So copying it from a new and replacing strings worked this time.
Ilya, just so you know the file you referred to should be
/etc/webmin/virtual-server/custom-lang
and not/etc/webmin/virtual-server/custom_lang
.I really have no idea, that question should be addressed to Jamie as unfortunately there is no detailed documentation on the lgnauge files and we are just following the instructions given to us before on https://www.virtualmin.com/node/31006
What about content of the
/usr/libexec/webmin/authentic-theme/lang/en
file? Replacing some strings in it doesn't seem to have any effect. It is not clear where should we copy this file to.Well, because of exactly this kind of things that are need to be polished we really didn't want to roll out this otherwise excellent theme to the end-users. I understand it will take time to find out this kind of issues and we are ready to heavily start testing the new theme and helping to find out all the nuances, but please try to understand our position as hosting vendor - we run hundreds of Virtualmin servers with customized interfaces and their end-users are now all confused.
Submitted by yngens on Thu, 01/07/2016 - 19:16 Comment #6
Jamie, I find this a bit inconvenient. Can you write couple more line of code (if possible by design), so that theme's custom_lang file could contain all possible strings from all modules that a user wants to override.
Whatever format you, *-min team, choose between yourselves we are ready to accept and follow. But please find some consensus on this kind of things as this kind of ambiguity is effecting us, *-min users.
Submitted by JamieCameron on Thu, 01/07/2016 - 19:31 Comment #7
So it wouldn't work to have a single override file for all modules, as there can be duplicates.
Instead, you need to create an /etc/webmin/MODULE/custom-lang file to override strings for each module.
Submitted by yngens on Thu, 01/07/2016 - 22:42 Comment #8
Guys, could you please point out how to replace all the "Webmin" strings in the attached screenshot block?
Submitted by JamieCameron on Thu, 01/07/2016 - 23:48 Comment #9
Those are module titles, which have to be over-ridden in a different way. You can do this in the Webmin UI, at Webmin -> Webmin Configuration -> Module Titles.
@JamieCameron Jamie, this is why I mentioned the following:
module-name:left_generic=Create Domains
Regards,
Ilia
It's fixed in 17.40. Please upgrade.
Submitted by yngens on Wed, 02/03/2016 - 16:20 Comment #12
Ilia, could you please tell me how can we override "Webmin" in the login screen like shown in the attached screenshot?
Not sure what you mean but if you want not to display the host name, you could do the following by adding it to theme's extensions (CSS):
Submitted by yngens on Sun, 02/07/2016 - 16:35 Comment #14
Not the hostname, but the word "Webmin" itself. I don't know how to make this clearer.
Uupps. I see now. In 17.64 it will be dependent on
theme_xhred_titles_wm
andtheme_xhred_titles_um
lang strings as it should have been.Thanks for reporting.
17.64 is out, please upgrade.