DYN-10101 : dynamo opens wrong samples directory when opening containing folder for a different locale#16871
Merged
Conversation
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-10101
Contributor
There was a problem hiding this comment.
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
SamplesDirectoryto a lazy-loading property that evaluates on first access (when preferences are loaded) - Refactored
GetSamplesFolderto accept a locale parameter instead of usingCultureInfo.CurrentUICulturedirectly - 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 |
zeusongit
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This PR addresses DYN-10101, where the open containing folder action on sample files always opened the
en-USsamples directory, regardless of the user's locale preference setting in Dynamo.The issue was an initialization order problem:
PathManagerwas constructed andsamplesDirectorywas set usingCultureInfo.CurrentUICulture. At this point preferences are not loaded yet, soCurrentUICulturewas always the system default.Proposed resolution:
samplesDirectoryinPathManager.BuildCommonDirectoriesSamplesDirectoryto a lazy-loading property that calculates the path on first accessen-USGetSamplesFolderto accept alocaleargumentDeclarations
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-USsamples directory, regardless of the user's locale preference setting in Dynamo.Reviewers
@zeusongit
@DynamoDS/eidos
FYIs
@dnenov
@achintyabhat