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

DYN-5961 Set Dynamo locale based on setting or host #14486

Merged
merged 3 commits into from
Oct 18, 2023
Merged

Conversation

QilongTang
Copy link
Contributor

@QilongTang QilongTang commented Oct 16, 2023

Purpose

Introduce Default option in Language switch, which sets Dynamo locale based on setting or host, pending some testing

Screenshot:
image

Behavior:

  • Default will be the default option for fresh Dynamo launch
  • Default option in DynamoSandbox means en-US
  • Default option in Dynamo in-process integration means following the host locale setting, based on the fact both DynamoRevit and DynamoC3D modifies HostAnalyticsInfo object
  • Default option in Dynamo out-of-process integration means en-US or following host locale setting, depending on if integrator modifies HostAnalyticsInfo object
  • Dynamo still respect if user picked specific language option

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Release Notes

Set Dynamo locale based on setting or host

Reviewers

@DynamoDS/dynamo

FYIs

(FILL ME IN, Optional) Names of anyone else you wish to be notified of

@QilongTang QilongTang added the WIP label Oct 16, 2023
@QilongTang QilongTang added this to the 3.0 milestone Oct 16, 2023
public static void SetUICulture(string locale)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo(locale == "Default" ? "en-US" : locale);
Thread.CurrentThread.CurrentCulture = new CultureInfo(locale == "Default" ? "en-US" : locale);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These code were added in Dynamo 2.18 but removed in Dynamo 2.19. So this would mean adding these code back but conditionally (in-process integration)

@QilongTang
Copy link
Contributor Author

Only regression fixed by updating baseline test TestSettingsSerialization to use Default as default locale value in preferences.

@QilongTang QilongTang merged commit 689879e into master Oct 18, 2023
25 checks passed
@QilongTang QilongTang deleted the SetDynamoLocale branch October 18, 2023 19:44
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.

2 participants