Skip to content

Enhancements to ReturnCodeMapper#785

Merged
rdmark merged 1 commit intoPiSCSI:developfrom
nucleogenic:webui-return-code-mapper-tweaks
Aug 4, 2022
Merged

Enhancements to ReturnCodeMapper#785
rdmark merged 1 commit intoPiSCSI:developfrom
nucleogenic:webui-return-code-mapper-tweaks

Conversation

@nucleogenic
Copy link
Copy Markdown
Member

@nucleogenic nucleogenic commented Aug 3, 2022

This change set was originally on another branch, but I ended up not needing to use ReturnCodeMapper.

  • Fixes error preventing use of payloads without parameters
  • Removes redundant calls to _ (gettext) wrapping message strings
  • Formatting to avoid wrapping of message strings (subjective: readability improvement)

"""Module for mapping between rascsi return codes and translated strings"""

from rascsi.return_codes import ReturnCodes
from flask_babel import _, lazy_gettext
Copy link
Copy Markdown
Member

@rdmark rdmark Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm missing a crucial step here, I think the _ calls are still needed for l10n to work. For testing, I checked out this branch and went through the steps to generate messages.pot and then merge with existing translations. As far as I can tell, gettext/babel are not picking up the strings in this file for translation anymore.

See: https://python-babel.github.io/flask-babel/index.html#translating-applications

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! Yes, that makes total sense. I've reverted the change. Thanks 🙏

@nucleogenic nucleogenic force-pushed the webui-return-code-mapper-tweaks branch from 6ef1a99 to bfa25ce Compare August 4, 2022 23:29
…rs, formatting to avoid wrapping of messages
@nucleogenic nucleogenic force-pushed the webui-return-code-mapper-tweaks branch from bfa25ce to 078d0fc Compare August 4, 2022 23:37
@rdmark rdmark merged commit a523e1f into PiSCSI:develop Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants