Skip to content

ResourcesGenerationTask fails to generate properly if solution path contains the wrong string #4657

Closed

Description

@Xiaoy312

Current behavior

Localization doesnt work when path of project contains one of the TwoLetterISOLanguageNames from CultureTypes.SpecificCultures.

How to reproduce it (as minimally and precisely as possible)

  • create a new uno project in a folder whose path contains a language tag (ex: "aa", "af", "ak")

    it can be a subpath, or part of subpath separated by point . or comma _
    D:\code\cs\MyUnoProject

  • add any localization
  • notice it doesnt work in app (except on UWP)

Workaround

Move project root directory.

Environment

  • ? Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
  • ? Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
  • Uno.SourceGenerationTasks
  • Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
  • Other:

Nuget Package Version(s): 3.1.0-beta.76

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
    • Tizen
  • Windows
  • Build tasks
  • Solution Templates

IDE:

  • Visual Studio 2017 (version: )
  • Visual Studio 2019 (version: )
  • Visual Studio for Mac (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )
  • Visual Studio Code (version: )

Anything else we need to know?

var ltags = CultureInfo.GetCultures(CultureTypes.SpecificCultures).Select(c => c.TwoLetterISOLanguageName).ToArray();
@"D:\code\cs\MyUnoProject\iAMobile.Views\Strings\en\Resources.resw"
	.Split(Path.DirectorySeparatorChar, '_', '.')
	.Where(ltags.Contains)
	.Dump();

If the above code matches anything other than "en", there is a problem. And given the size of ltags, the chance is pretty decent.

Activity

  1. added
    kind/bug
    triage/untriaged
    area/code-generation
    on Dec 3, 2020
  2. Xiaoy312 commented on Dec 3, 2020

    @Xiaoy312
    ContributorAuthor

    https://github.com/unoplatform/uno/blob/3.1/src/SourceGenerators/Uno.UI.Tasks/ResourcesGenerator/ResourcesGenerationTask.cs#L75
    ^ the relative path should be passed instead for the 2nd argument.

    GitHub
    Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported. - unoplatform/uno
  3. added
    project/core-tools 🛠️
    and removed
    triage/untriaged
    on Dec 3, 2020
  4. jeromelaban commented on Dec 3, 2020

    @jeromelaban
    Member

    Nice find!!

  5. added
    difficulty/tbd
    on Feb 15, 2021
  6. added
    difficulty/medium 🤔
    and removed
    difficulty/tbd
    on Jun 2, 2021
  7. added this to the 3.9 milestone on Jun 2, 2021
  8. removed this from the 3.9 milestone on Aug 11, 2021
  9. added
    triage/potentially-fixed
    on Jun 1, 2023
  10. github-actions commented on Jul 28, 2025

    @github-actions
    Contributor

    Hey there — just a heads-up that this issue has been quiet for over a year. If there’s no update or comment in the next 10 days, it’ll be closed automatically. Feel free to remove the stale label or drop a note to keep it open.

  11. added
    stale
    on Jul 28, 2025
  12. removed
    stale
    on Jul 28, 2025
  13. MartinZikmund commented on Jul 28, 2025

    @MartinZikmund
    Member

    Maybe still relevant, needs to be validated

  14. MartinZikmund commented on Apr 8, 2026

    @MartinZikmund
    Member

    Repro generator

    This issue was classified as not reproducible with a code sample or test.

    Reason: This is a build task/code generation issue (ResourcesGenerationTask) that depends on the project's filesystem path containing specific ISO language code substrings. Reproducing this requires a specific directory structure on disk rather than a runtime test or UI sample within the existing repo.

  15. self-assigned this
    on Jun 5, 2026
  16. added a commit that references this issue on Aug 3, 2026
    358e4ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/code-generationdifficulty/medium 🤔kind/bugno-reproproject/core-tools 🛠️triage/potentially-fixed

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions