Skip to content

wasm或者hybird在什么地方初始化载入设置默认文化信息? #3399

Answered by ArgoZhang
densen2014 asked this question in Q&A
Discussion options

You must be logged in to vote

MAUI

MauiProgram file

public static MauiApp CreateMauiApp()
{
    // 增加 BootstrapBlazor 组件服务
    builder.Services.AddBootstrapBlazor();

    // 增加 Table 数据服务操作类
    builder.Services.AddTableDemoDataService();

    CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");

    return builder.Build();
}

Build 或者 Run 之前设置下面即可

CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@densen2014
Comment options

densen2014 May 2, 2024
Collaborator Author

@ArgoZhang
Comment options

Answer selected by densen2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants