Skip to content

Adds support to LocalizationStreamParser for po entrys spanning multiple lines#7752

Merged
sebastienros merged 2 commits intoOrchardCMS:1.10.xfrom
andrewcartwright1:patch-1
Jul 6, 2017
Merged

Adds support to LocalizationStreamParser for po entrys spanning multiple lines#7752
sebastienros merged 2 commits intoOrchardCMS:1.10.xfrom
andrewcartwright1:patch-1

Conversation

@andrewcartwright1
Copy link
Copy Markdown
Contributor

After spending some time making our gulp localization task work I came across an issue were some PO entries were half complete and noticed that they had been shifted into a new line by the task - after reviewing it, it wraps at 78 characters which seemed like an issue, but after some research, string wrapping is perfectly fine: http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html

The summary of my change is instead of reading line by line and determining what we are working with later on... do the following.

  • Work out what scope we are looking at
  • Check the next line, if its not another scope, append it to the current line and loop through till we find another scope (hence building the key, string, comment or scope)

Afterwards, check what scope we started with and do the required action.

@dnfclas
Copy link
Copy Markdown

dnfclas commented Jul 4, 2017

@andrewcartwright1,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

@gcsuk
Copy link
Copy Markdown
Contributor

gcsuk commented Jul 4, 2017

👍

if (str.StartsWith("\"") && str.EndsWith("\"")) {
if (str.Length == 1) {
// Handle corner case - string containing single quote
Logger.Warning("Invalid localization string detected: " + str);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to readd this.

@sebastienros sebastienros merged commit eff2078 into OrchardCMS:1.10.x Jul 6, 2017
@andrewcartwright1 andrewcartwright1 deleted the patch-1 branch July 6, 2017 21:35
@BenedekFarkas BenedekFarkas added this to the Orchard 1.10.3 milestone Feb 26, 2019
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.

5 participants