Controversies in translation for log and exception.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.i18n |
New
|
Undecided
|
Unassigned |
Bug Description
This bug tracker is for errors with the documentation, use the following as a template and remove or add fields as you see fit. Convert [ ] into [x] to check boxes:
- [x] This doc is inaccurate in this way:
there are controversies regarding translating a string for logging and exception:
1. we translate a string and put it in log and exception
# Log and Raise
msg = _('Unexpected error message')
LOG.
raise RuntimeError(msg)
https:/
2. we put one not translated string in log and another translated string in exception
For example, do not do this:
# WRONG
msg = _('There was an error.')
LOG.error(msg)
raise LocalExceptionC
or this:
# EVEN MORE WRONG
msg = _LE('There was an error.')
LOG.error(msg)
raise LocalExceptionC
Instead, use this style:
# RIGHT
LOG.error('There was an error.')
raise LocalExceptionC
https:/
- [ ] This is a doc addition request.
- [ ] I have a fix to the document that I can paste below including example: input and output.
If you have a troubleshooting or support issue, use the following resources:
- The mailing list: https:/
- IRC: 'openstack' channel on Freenode
-------
Release: 5.1.0.dev6 on 2018-09-12 22:18:36
SHA: 8609dc2c4ceacd2
Source: https:/
URL: https:/