Is there a way to set fail2ban to english

Why does the f2b Tag not work? sorry that i used another

What type of hardware are you using: Old laptop or computer
What YunoHost version are you running: 12.0.11
What app is this about: fail2ban allways in french

Describe your issue

Hi capable people,
I have some trouble using Fail2Ban because it is always in French. Firefox has a translate feature, but it is resetting after every click. It’s a bit annoying, and I wonder if there is a way to switch the application’s language permanently.

thanks in advance

B.

Share relevant logs or error messages

https://paste.yunohost.org/raw/idamagehoc

Hi barep,

Welcome to the forums!

Your post is about the web-interface, not about fail2ban itself, correct?

I just tried installing it, the result is an English-speaking interface:

Seeing your log, I assume your Yunohost does not run French or English.

The app has this bit (in /var/www/fail2ban-web/engine.inc.php), where it tries to match the app to your system language and falls back to French if no match is found

  #####################
  #     LANGUAGE      #
  #####################
  $lang=substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
  if(stream_resolve_include_path("language/$lang.php")) {
    include ("language/$lang.php");
  } else {
    include ("language/fr.php");
  }

As long as there is no German translation provided, there are three possible poor-man’s workarounds:

  • Change the aboove bit to read "else ( include (“language/en.php”);
  • Make a copy of the English language file (at /var/www/fail2ban-web/language) and name it de.php (I think , for German)
  • Delete the french laguage file, and rename the English one to fr.php

None of these will win beauty contest, but I would go with the first option.

Your changes may be overwritten by an app upgrade, but at least its a bit more of a permanent solution than the Firefox translate.

1 Like

I have a better idea. Clone that repo, add German language (de.php for example, simply copy the content of the English file), propose it to the dev and ask him if it’s possible to integrate it to the app.

1 Like

i switched fallback language to english in upcoming ynh version.
See here : Release v1.3 · ewilly/fail2ban-web-interface-php · GitHub
as @jarod5001 say feel free to propose me a German version of that file fail2ban-web-interface-php/language/en.php at master · ewilly/fail2ban-web-interface-php · GitHub i will integer it with pleasure :slight_smile:
PS : sorry did not see your issue on github

3 Likes

Wow that was quick!!
Thanks alot. I try to look in to a translation to german. But im not the most techie guy. I’ll put it in the github rep.

Thanks a lot!!