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

Fix localization rule \Localization\[CultureName]\[ModuleId].po #16419

Merged
merged 24 commits into from
Aug 15, 2024

Conversation

hyzx86
Copy link
Contributor

@hyzx86 hyzx86 commented Jul 10, 2024

Fixes #16153

unit test at :#16154

@Piedone
Copy link
Member

Piedone commented Jul 11, 2024

@hishamco could you please review both PRs?

@hishamco
Copy link
Member

Sure, in my list

@Piedone
Copy link
Member

Piedone commented Jul 11, 2024

Thank you!

@Piedone Piedone requested a review from hishamco July 11, 2024 12:46
@sebastienros
Copy link
Member

Looks good. Can you add a unit test? Not with a web app, really a unit test.

@hyzx86
Copy link
Contributor Author

hyzx86 commented Jul 13, 2024

@hishamco Ready to review 😊

@@ -195,6 +195,7 @@ node_modules/

wwwroot
**/Localization/**/*.po
!test/OrchardCore.Tests/Localization/**/*.po
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

@hyzx86 hyzx86 Jul 14, 2024

Choose a reason for hiding this comment

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

You must do this, or you will lose the PO files. You can try it.

[InlineData("zh-CN", "你好!")]
public async Task TestLocalizationRule(string culture, string expected)
{
var context = new SiteContext();
Copy link
Member

Choose a reason for hiding this comment

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

This is a functional test, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I don't understand what you mean. I think this is the closest test to the actual operation.

Comment on lines +83 to +88
<ItemGroup>
<None Update="Localization\*\OrchardCore.Tests.po">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

Copy link
Member

Choose a reason for hiding this comment

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

No need, you can add them as embedded resources

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are not same.

Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to preserve the newest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the target rule needs to copy it to the output directory.

Copy link
Contributor

This pull request has merge conflicts. Please resolve those before requesting a review.

@sebastienros sebastienros merged commit bbacbe1 into OrchardCMS:main Aug 15, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/Localization/[CultureName]/[ModuleId].po PO file location doesn't work
4 participants