追踪全球化进程

发布于 2024-07-06 00:54:46 字数 150 浏览 6 评论 0原文

在我们的下一个主要版本中,我们希望全球化我们的 ASP.Net 应用程序,我被要求想出一种方法来跟踪在这项工作中已经处理过的代码。

我的想法是使用自定义属性并将其放置在所有已“修复”的类上。

你怎么认为?

有人有更好的主意吗?

With our next major release we are looking to globalize our ASP.Net application and I was asked to think of a way to keep track of what code has been already worked on in this effort.

My thought was to use a custom Attribute and place it on all classes that have been "fixed".

What do you think?

Does anyone have a better idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

山人契 2024-07-13 00:54:46

为应用程序中的每个页面编写一个单元测试怎么样? 单元测试将加载页面并执行

foreach (System.Web.UI.Control c in Page.Controls)
{
    //Do work here
}

工作部分,加载不同的全球化设置并查看 .Text 属性(或应用程序的相关属性)是否不同。

我的假设是,除了最简单的情况之外,任何语言都不会出现相同的结果。

使用成功完成的一组单元测试来跟踪您的进度。

How about writing a unit test for each page in the app? The unit test would load the page and perform a

foreach (System.Web.UI.Control c in Page.Controls)
{
    //Do work here
}

For the work part, load different globalization settings and see if the .Text property (or relevant property for your app) is different.

My assumption would be that no language should come out the same in all but the simplest cases.

Use the set of unit tests that sucessfully complete to track your progress.

痴骨ら 2024-07-13 00:54:46

只计算或列出班级,然后逐个班级进行工作怎么样? 虽然属性可能是一个有趣的想法,但我认为它是过度设计的。 全球化只不过是遍历每个类并全球化代码:)

无论如何,您都想在下一个版本之前完成它。 因此,继续一项一项地去做,你就会取得进步。 我认为每个班级提出的缺陷也太多了。

在我的上一个项目中,我开始全面全球化有点晚了。 我刚刚从上到下浏览了代码文件列表。 在我的例子中按字母顺序排列,一个文件夹接一个文件夹。 所以我总是只需要记住我上次处理的是哪个文件。 这对我来说效果很好。

编辑:另一件事:在我的上一个项目中,全球化主要涉及将硬编码字符串移动到资源文件,并在运行时语言发生变化时重新生成所有文本。 但您还必须考虑数字格式等问题。 微软的 FxCop 帮助我解决了这个问题,因为它标记了所有数字转换等,而不将文化指定为违规。 FxCop 会对此进行跟踪,因此当您解决此类违规并重新运行 FxCop 时,它会将违规报告为缺失(即已解决)。 这对于这些难以看到的事物特别有用。

What about just counting or listing the classes and then work class by class? While an attribute may be an interesting idea, I'd regard it as over-engineered. Globalizing does nothing more than, well, going through each class and globalizing the code :)

You want to finish that anyway before the next release. So go ahead and just do it one by one, and there you have your progress. I'd regard a defect raised for each class as too much either.

In my last project, I started full globalization a little late. I just went through the list of code files, from top to bottom. Alphabetically in my case, and folder after folder. So I always only had to remember which file I last worked on. That worked pretty well for me.

Edit: Another thing: In my last project, globalizing mainly involved moving hard-coded strings to resource files, and re-generating all text when the language changes at runtime. But you'll also have to think about things like number formats and the like. Microsoft's FxCop helped me with that, since it marks all number conversions etc. without specifying a culture as violations. FxCop keeps track of this, so when you resolved such a violation and re-ran FxCop, it would report the violation as missing (i.e. solved). That's especially useful for these harder-to-see things.

孤云独去闲 2024-07-13 00:54:46

使用属性来确定哪些类已被全球化将需要一个工具来处理代码并确定哪些类已被“处理​​”和尚未被“处理”,这似乎变得有点复杂。

更传统的项目跟踪过程可能会更好 - 并且不会用属性/其他标记“污染”您的代码,这些属性/其他标记在全球化项目结束后没有任何功能意义。 为每个需要工作的类提出一个缺陷并以这种方式跟踪它怎么样?

Using an attribute to determine which classes have been globalized would then require a tool to process the code and determine which classes have and haven't been "processed", it seems like it's getting a bit complicated.

A more traditional project tracking process would probably be better - and wouldn't "pollute" your code with attributes/other markup that have no functional meaning beyond the end of the globalisation project. How about having a defect raised for each class that requires work, and tracking it that way?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文