derrix060 / onedriveClient

A Microsoft OneDrive and OneDrive for Business client for Linux, written in Python3.
MIT License
65 stars 10 forks source link

Change hard-coded logs to translated. #24

Open derrix060 opened 5 years ago

derrix060 commented 5 years ago

This is not something urgent but will be good once the project starts to get big. The idea is to use the pre-existent translate method. Example:

How it is:

    def add_watch(self, repo, local_abspath):
        logging.debug('Adding watcher for "%s"', local_abspath)

How should be:

    def add_watch(self, repo, local_abspath):
        logging.debug(translator['od_watcher.add_watch.add_watch.log']', local_abspath)

To see more examples, search for translator on od_pref.py

modelmat commented 5 years ago

How can this be done with docstrings, and should this be done for when errors are raised?

derrix060 commented 5 years ago

I don't think it should be done with docstrings. Docstrings are for developers only, and I think should be in English. These messages are for loggings and errors.

modelmat commented 5 years ago

So for raised errors too?

derrix060 commented 5 years ago

Yes. All messages that a normal user can view...

derrix060 commented 5 years ago

Do you want to work on this one? I can assign it for you

modelmat commented 5 years ago

yes, I am working on it too.

modelmat commented 5 years ago

Ah fudge. Reinstalled linux and accidentally deleted all my hours of progress... oh well.