实现多语言/全球化在很大程度上.NET项目的最佳方法很大程度上、多语言、方法、项目

2023-09-02 10:53:50 作者:我要去幼儿园深造

我会很快在一个大型的C#项目,并希望建立从一开始就支持​​多国语言。我有一个发挥作用的,可以得到它的工作使用的每种语言单独的资源文件,然后使用资源管理器来加载字符串。

I'll soon be working on a large c# project and would like to build in multi-language support from the start. I've had a play around and can get it working using a separate resource file for each language, then use a resource manager to load up the strings.

有没有,我可以考虑任何其他的好办法?

Are there any other good approaches that I could look into?

推荐答案

我实现了使用多种不同的方法看到的项目,每个人都有自己的优点和缺点。

I've seen projects implemented using a number of different approaches, each have their merits and drawbacks.

在一个这样做是在配置文件(不是我最喜欢的) 在一个做到了使用数据库 - 这个工作pretty的很好,但在你知道要保持什么是痛苦 在一个使用的资源文件时,你是在暗示的方式,我不得不说这是我最喜欢的方式。 在最基本的一个使用包含文件全串做到了 - 。丑

我说你所选择的资源的方法使得有很大的意义。这将是有趣的,看看别人的答案,也因为我常常在想,如果有这样搞的更好的方法。我见过无数的资源,所有指向利用资源的方法,包括one这里的SO 。

I'd say the resource method you've chosen makes a lot of sense. It would be interesting to see other people's answers too as I often wonder if there's a better way of doing things like this. I've seen numerous resources that all point to the using resources method, including one right here on SO.