4elta / recon

automate the boring stuff!
GNU General Public License v3.0
8 stars 3 forks source link

[WIP]: Add localization for analyzers #59

Closed ikstream closed 1 year ago

ikstream commented 1 year ago

Translate analyzer output into German with the option to add more translations later on.

ikstream commented 1 year ago

I am basically following this guide here https://inventwithpython.com/blog/2014/12/20/translate-your-python-3-program-with-the-gettext-module/

4elta commented 1 year ago

by the way, have you thought about how to translate the text related to the TLS vulnerabilities?

ikstream commented 1 year ago

I will look into TLS as well. At the moment I hope, that it will work just the same way as the rest.

4elta commented 1 year ago

i would prefer to initialize the analyzer's translation service (i.e. gettext) via the analyzer's constructor:

analyzer = module.Analyzer(service, recommendations, language=lang)

you would have to update the AbstractAnalyzer's constructor:

def __init__(self, name, recommendations, language=None):
   ...

   self.language = language

   if language:
     # initialize 'gettext'

that way, you could store the language in the analyzer class (i.e. AbstractAnalyzer and respectively the concret implementation class).