Skip to content

Conversation

Tom5521
Copy link
Contributor

@Tom5521 Tom5521 commented Feb 27, 2025

Is this a fix, improvement or something else?

Fix


What does this change implement/fix?

Fixes quote and backslash escaping in PO file generation. The previous implementation couldn't properly handle strings with quotes or special characters, causing syntax errors in the generated files. Replaced string splitting with character-by-character processing to correctly escape all special characters and handle multiline strings properly.


I have ...

  • answered the 2 questions above,
  • discussed this change in an issue,
  • included tests to cover this changes.

It didn't even have its own tests before, in the first place -_-

Replaced string splitting approach with proper character-by-character handling to correctly escape quotes in both normal and raw strings.

Improved string formatting with dedicated functions for multiline content and special character escaping.

Also simplified the maxArgIndex function.

These changes resolve syntax errors in generated PO files.
@leonelquinteros leonelquinteros merged commit 564c4cb into leonelquinteros:master Mar 18, 2025
4 checks passed
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