Skip to content

Conversation

hishamco
Copy link
Member

Related to #76

@Skrypt we could ignore \r instead of throwing an exception

@Skrypt
Copy link
Contributor

Skrypt commented Dec 15, 2023

That would not work because the string would still be there in Orchard Core?

It would try to still find a string that has that \r\n

@S["Something\r\n"]

If you ignore it then that string will never match any translated PO string.

@hishamco
Copy link
Member Author

That would not work because the string would still be there in Orchard Core?

Could you please elaborate?

It would try to still find a string that has that \r\n

There's no string in OC has \r\n

@Skrypt
Copy link
Contributor

Skrypt commented Dec 19, 2023

OC or not. When you use the POExtractor it will extract strings in code.
If you escape \r­ from the POExtractor then it will create a string in the resulting PO file that doesn't contain it.
Which means that it will never match anything from your code.

@t["Something \r\n"] --> in your C# code will become

msgid "Something \n"

Then when you try to load translations it will try to find a matching string for "Something \r\n" still which will result in that string to never be translated unless you remove the "\r" from your code. Here, you need to warn the user that you found a "\r" in the code and that you escaped it else the user will never know about it.

@hishamco
Copy link
Member Author

We might log a warning when the user is using \r only

# Conflicts:
#	src/OrchardCoreContrib.PoExtractor/PoWriter.cs
#	test/OrchardCoreContrib.PoExtractor.Tests/PoWriterTests.cs
@hishamco
Copy link
Member Author

@Skrypt, anything to add here, or shall I merge coz I need to bump the package

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