Skip to content

DYN-10101 : dynamo opens wrong samples directory when opening containing folder for a different locale#16871

Merged
zeusongit merged 3 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-10101-Dynamo-opens-wrong-samples-directory-when-opening-containing-folder-for-a-different-locale
Feb 4, 2026
Merged

DYN-10101 : dynamo opens wrong samples directory when opening containing folder for a different locale#16871
zeusongit merged 3 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-10101-Dynamo-opens-wrong-samples-directory-when-opening-containing-folder-for-a-different-locale

Conversation

@ivaylo-matov
Copy link
Copy Markdown
Contributor

@ivaylo-matov ivaylo-matov commented Feb 3, 2026

Purpose

This PR addresses DYN-10101, where the open containing folder action on sample files always opened the en-US samples directory, regardless of the user's locale preference setting in Dynamo.

The issue was an initialization order problem:
PathManager was constructed and samplesDirectory was set using CultureInfo.CurrentUICulture. At this point preferences are not loaded yet, so CurrentUICulture was always the system default.

Proposed resolution:

  • removed initialization of samplesDirectory in PathManager.BuildCommonDirectories
  • converted SamplesDirectory to a lazy-loading property that calculates the path on first access
  • at first access, preferences are already loaded, so the correct locale is used
  • added logic to handle the "Default" locale setting by falling back to en-US
  • refactored GetSamplesFolder to accept a locale argument
  • added unit test

DYN-10101

Declarations

Check these if you believe they are true

Release Notes

Fixes a bug where the open containing folder action on sample files always opened the en-US samples directory, regardless of the user's locale preference setting in Dynamo.

Reviewers

@zeusongit
@DynamoDS/eidos

FYIs

@dnenov
@achintyabhat

Copilot AI review requested due to automatic review settings February 3, 2026 17:03
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-10101

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes DYN-10101 where opening the containing folder for sample files always opened the en-US directory instead of respecting the user's locale preference. The root cause was an initialization order issue where PathManager set the samples directory before preferences were loaded, causing it to use the system default culture instead of the user's configured locale.

Changes:

  • Converted SamplesDirectory to a lazy-loading property that evaluates on first access (when preferences are loaded)
  • Refactored GetSamplesFolder to accept a locale parameter instead of using CultureInfo.CurrentUICulture directly
  • Added test coverage to verify samples directory respects locale preferences

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/DynamoCore/Configuration/PathManager.cs Implemented lazy-loading for SamplesDirectory property, refactored GetSamplesFolder to accept locale parameter, and fixed typo "netural" to "neutral"
test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs Added unit test to verify SamplesDirectory respects locale preferences

Comment thread src/DynamoCore/Configuration/PathManager.cs Outdated
Comment thread test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs Outdated
@QilongTang QilongTang requested a review from a team February 4, 2026 20:56
@zeusongit zeusongit merged commit 01d1e42 into DynamoDS:master Feb 4, 2026
25 of 27 checks passed
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.

3 participants