Internationalization of write_config() text
-
Sometimes the text supplied with a write_config() call is internationalized with gettext() and thus can potentially log that in the config history in some language other than English, e.g.
/usr/local/www/index.php: write_config(gettext("Widget configuration has been changed."));
Should all the write_config("text") calls be done that way - write_config(gettext("text")) ?
I would seem OK to me that config history text can be recorded in the user's chosen language.
Also there are many (many many) write_config() calls that have no text supplied at all. I would find it helpful if the text in the config history were better (or existed at all), so I am happy to put some (hopefully useful) text in each write_config() call.
Should I just do a few and submit a PR with typical examples of what I think is good?
Then it can be reviewed and I can proceed doing it in ways that reviewers [have suggested|agree with].
-
Sometimes the text supplied with a write_config() call is internationalized with gettext() and thus can potentially log that in the config history in some language other than English, e.g.
/usr/local/www/index.php: write_config(gettext("Widget configuration has been changed."));
Should all the write_config("text") calls be done that way - write_config(gettext("text")) ?
I would seem OK to me that config history text can be recorded in the user's chosen language.
Also there are many (many many) write_config() calls that have no text supplied at all. I would find it helpful if the text in the config history were better (or existed at all), so I am happy to put some (hopefully useful) text in each write_config() call.
Should I just do a few and submit a PR with typical examples of what I think is good?
Then it can be reviewed and I can proceed doing it in ways that reviewers [have suggested|agree with].
Yeah, definitely it's a good idea. Just need to check if the tag used to store these strings uses CDATA on config.xml to avoid breaking it
-
The revision section of config.xml has a good-looking description format
<revision><time>1452883508</time> <username>admin@192.168.1.100</username></revision>
and that is what is written to and used by diag_confbak to display the reason for each config in the history.
So it looks good to be multi-lingual.