Localize Core Messages#2664
Conversation
Import l10n translations earlier and replace hard-coded popup/notification strings with tr.tl(...) calls using CR/LF placeholders. Standardize message formatting across journal-lock, process-already-running, update notifications, provider reset, plugin errors and critical error dialogs, remove manual \"replace('\\n','\n').replace('\\r','\r')\" post-processing and the duplicate l10n import. This consolidates i18n handling and normalizes linebreak formatting for localized messages.
Update L10n/en.template to replace literal CRLF sequences in several localized popup strings with {LF}{CR} placeholders for consistent newline handling. Also add two new localization entries for journal-lock and duplicate-process startup warnings and adjust plugin, provider-reset, and update-track messages to use the new placeholders.
|
I'm wary about the newline conversion to {LF}{CR}{LF}{CR}. How will this impact bundled languages? Will updates need to be made to every language or risk crashes? (While in theory I'm not against standardizing newlines, it's one of those "the way it's always been" things that I'm worried might introduce unintended consequences. |
Wrap several user-facing messages and labels in the translation helper (tr.tl) and add LANG comments for clarity. Replace ad-hoc CR/LF placeholders with a single EOL replacement ("\r\n") for consistent end-of-line handling across popups and dialogs. Changes affect update-track prompts, killswitch popup text and title, provider-reset notifications, critical error details, and plugin-related warning popups, and make the OK button label translatable.
Normalize localization messages by replacing legacy {LF}{CR} sequences with the {EOL} token and updating comment metadata/line references across EDMarketConnector entries (critical error details, plugin warnings, broken plugin text, provider reset messages, Beta->Stable notice, etc.). Clarify OK button comment to include the killswitch dismiss button. Add new localization keys for the killswitch popup: body text, title "EDMC Features have been disabled", and the "Version: {VERSION}" label.
Unify CR placeholder replacement in l10n module
Remove .format(CR="\n") calls from EDMarketConnector.py and companion.py
to centralize line break handling in the localization module. The l10n.py
module already replaces {CR} placeholders during translation parsing.
This simplifies the codebase by eliminating redundant format() calls
and ensuring consistent behavior across all localized strings.
|
Hey @Rixxan, thanks for the feedback! Your concern was valid, here's the full picture: How placeholders are handled
Behavior with existing translations
Impact on Crowdin
Conclusion
TODO (next step)In a follow-up (either in this PR or a new one), we can move the
This would let us remove all inline |
Description:
This PR implements localization for core application messages in EDMarketConnector.py, enabling translation of critical user-facing strings such as error popups, notifications, and startup warnings. The changes standardize message formatting and consolidate i18n handling across the application.
This work is a parallel integration to PR #2617, which localized the authentication success message. Together, these changes expand localization coverage to additional core UI elements while maintaining consistency with the established patterns.
Key Changes:
tr.tl()calls for proper translation support.{LF}{CR}placeholders in localization strings to handle line breaks consistently, replacing manualreplace('\\n','\n').replace('\\r','\r')post-processing.Files Modified:
Benefits:
This PR targets the
developbranch and maintains backward compatibility while enhancing internationalization support. All changes are based on the existing l10n infrastructure and follow the project's translation patterns established in PR #2617.