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

ThisAssembly.Strings doesn't cope well with localized resx #173

Closed
kzu opened this issue Jan 28, 2023 · 0 comments · Fixed by #177
Closed

ThisAssembly.Strings doesn't cope well with localized resx #173

kzu opened this issue Jan 28, 2023 · 0 comments · Fixed by #177
Labels
bug Something isn't working

Comments

@kzu
Copy link
Member

kzu commented Jan 28, 2023

Add one .resx (culture neutral). Then add a localized version of it.

Result: compilation errors from duplicate Strings members
Expected: only the culture neutral resource should be considered for codegen. WithCulture on the items can be used to filter, such as:

  <Target Name="_RemoveCulturedResxFromStrings" AfterTargets="_InjectRexAdditionalFiles;_InjectResxAdditionalFiles" BeforeTargets="GenerateMSBuildEditorConfigFileShouldRun">
    <ItemGroup>
      <ResxCode Remove="@(ResxCode -&gt; WithMetadataValue('WithCulture', 'true'))" />
      <AdditionalFiles Remove="@(AdditionalFiles -&gt; WithMetadataValue('WithCulture', 'true'))" />
    </ItemGroup>
  </Target>
@kzu kzu added the bug Something isn't working label Jan 28, 2023
kzu added a commit that referenced this issue Jan 28, 2023
Only the neutral resources file should cause codegen. The localized ones basically have to be ignored.

Closes #173
@kzu kzu closed this as completed in #177 Jan 28, 2023
kzu added a commit that referenced this issue Jan 28, 2023
Only the neutral resources file should cause codegen. The localized ones basically have to be ignored.

Closes #173
@devlooped devlooped locked and limited conversation to collaborators Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant