Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/move text to locale #21

Merged
merged 2 commits into from
Jan 24, 2025
Merged

Fix/move text to locale #21

merged 2 commits into from
Jan 24, 2025

Conversation

NikitosKey
Copy link
Owner

This pull request includes several changes to improve the text formatting and menu handling in the bot's role-specific modules. The most important changes involve refactoring text generation into a new method, updating menu-building methods to be more flexible, and centralizing text constants in a localization file.

Refactoring and Text Formatting:

  • bot/roles/barman.py: Introduced a new method __pre_complete_order_text to generate order text, which is now used in __handle_pre_complete_order and __handle_complete_order methods. This change reduces code duplication and centralizes text formatting logic. [1] [2]

Menu Handling Improvements:

  • bot/roles/customer.py: Updated the method __build_show_products_menu to __build_products_menu to accept a prefix parameter, making it more flexible for different contexts. This change is reflected in multiple methods that build menus for product-related actions. [1] [2] [3]

Centralized Text Constants:

  • res/locales/ru.toml: Added new text constants for various order and product-related messages, which are now used throughout the code to ensure consistency and ease of localization.

Minor Adjustments and Fixes:

@NikitosKey NikitosKey merged commit 353e307 into dev Jan 24, 2025
1 of 2 checks passed
@NikitosKey NikitosKey deleted the fix/move_text_to_locale branch January 24, 2025 02:21
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.

1 participant