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

Backslash are not exported correctly for .strings files #7562

Closed
2 tasks done
nathanfallet opened this issue Apr 29, 2022 · 2 comments
Closed
2 tasks done

Backslash are not exported correctly for .strings files #7562

nathanfallet opened this issue Apr 29, 2022 · 2 comments
Labels
bug Something is broken. duplicate Similar issue or pull request already exists. translate-toolkit Issues which need to be fixed in the translate-toolkit

Comments

@nathanfallet
Copy link

nathanfallet commented Apr 29, 2022

Describe the issue

I have some strings in which I'm using LaTeX, so I have \. In Localizable.strings files, they need to be escaped as \\ (else they are treated as control chars).

My source strings is declared this way:

"example_card_1_content" = "The set of natural numbers is denoted as $\\mathbb{N}$:\n$$\\mathbb{N} = \\{0, 1, 2, 3, \\dots\\}$$";

After translations on weblate, it was exported like this:

"example_card_1_content" = "El conjunto de los números naturales se denota como $\mathbb{N}$:\n$$\mathbb{N} = \{0, 1, 2, 3, \dots\}$$";

So backslash are not escaped correctly!

Note that the same string is present in strings.xml files for Android, and it is exported correctly:

    <string name="example_card_1_content">El conjunto de los números naturales se denota como $\\mathbb{N}$:
 \n$$\\mathbb{N} = \\{0, 1, 2, 3, \\dots\\}$$</string>

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

Import any Localizable.strings file with a string containing \\, translate to another language using weblate, and see the exported string with only \ instead of \\.

Expected behavior

I expected the exported string to contain \\, like in the source string, and also like the android xml generated file.

Additional context

After inspection, translate/translate#4618 should fix the problem.

@nijel nijel added bug Something is broken. translate-toolkit Issues which need to be fixed in the translate-toolkit duplicate Similar issue or pull request already exists. labels Apr 29, 2022
@nijel
Copy link
Member

nijel commented Apr 29, 2022

Duplicate of translate/translate#4617

@nijel nijel marked this as a duplicate of translate/translate#4617 Apr 29, 2022
@nijel nijel closed this as completed Apr 29, 2022
@github-actions
Copy link

The issue you've reported needs to be addressed in the translate-toolkit. Please file the issue there, and include links to any relevant specifications about the formats (if applicable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken. duplicate Similar issue or pull request already exists. translate-toolkit Issues which need to be fixed in the translate-toolkit
Projects
None yet
Development

No branches or pull requests

2 participants