我应该如何在 VS 2010 中创建多语言文本翻译编辑器?

发布于 2024-11-10 06:05:29 字数 1790 浏览 0 评论 0 原文

下面介绍的功能可在 ERP 应用程序 Microsoft Dynamics AX(以前称为 Axapta)中使用。但是,我的问题与 Visual Studio 2010 和 MVC 3 应用程序有关。请在此功能说明后查找我的问题。

  1. 屏幕截图 #1 显示使用 MorphX 编辑器以 X++(Microsoft Dynamics AX 中使用的语言)编写的方法。如果我选择双引号内的文本并右键单击它们,我将获得屏幕截图中所示的选项。如果文本以 @ 字符开头并且是在标签文件中找到的有效 ID,则情况如此。
  2. 如果我单击选项查找属性/方法,将会出现一个工具提示,显示与所选标签 ID 关联的实际文本。在本例中,标签 ID 为 @SYS67,其关联的标签文本为 交易日期。请参阅屏幕截图#2
  3. 如果我单击选项查找标签/文本,标签编辑器将出现,其中标签 ID 以及编辑器底部选择的其他语言已预先过滤。我可以使用编辑器更改不同语言的翻译文本。请参阅屏幕截图#3
  4. 在 Dynamics AX 中,标签文本存储在带有标签 ID 的文本文件中,并由制表符分隔。标签 ID 始终以 @ 符号开头。在示例中,@SYS 是组前缀,给定的数字是顺序索引。请参阅屏幕截图 #4,其中显示 en-us 标签文件中找到的文本。

据我了解,这类似于 Visual Studio 中的资源编辑器,其中翻译文本存储在每种语言的 .resx 文件中。我想对使用 SQL Server 数据库作为翻译文本的数据存储的 ASP.NET MVC 3 应用程序执行类似的操作。

以下是我的问题:

  1. 我需要在 Visual Studio 2010 中创建什么来实现此功能,以便可以在 IDE 中调用翻译编辑器?这是一个插件或扩展吗?

  2. 是否可以在 ASP.NET MVC 应用程序中执行类似的资源提供程序,在该应用程序中我可以在双引号内指定标签 ID,并让提供程序模型在运行时从数据库中获取数据?语法 Resources.MyResource.GetLabel("@SYS67"); 是 ASP.NET 中唯一可用的选项吗?抱歉,如果资源语法错误。

  3. 是否有任何类似的工具集(插件/扩展)可用于 Visual Studio?

  4. 我相信在 ASP.NET 应用程序中进行翻译的术语之一是利用资源提供程序模型。还有其他条款吗?我有兴趣知道我想要实现的目标的术语,以便我可以在网络上搜索以阅读更多相关信息。

任何意见将不胜感激。

提前致谢。

屏幕截图 #1:

1

屏幕截图 #2:

2

屏幕截图 #3:

3

屏幕截图#4:

4

Feature explained below is available in Microsoft Dynamics AX (formerly known as Axapta), an ERP application. However, my question is related to Visual Studio 2010 and MVC 3 application. Please find my questions after this feature explanation.

  1. Screenshot #1 shows a method written in X++ (language used in Microsoft Dynamics AX) using the MorphX editor. If I select a text within double quotes and right-click on them, I will get the options as shown in the screenshot. This is true if the text begins with an @ character and is a valid id found in the label file.
  2. If I click on the option Lookup Properties/Methods, a tool tip will appear showing the actual text associated with the selected label id. Here in this case the label id is @SYS67 and its associated label text is Transaction date. Refer screenshot #2.
  3. If I click on the option Lookup Label/Text, the label editor will appear with the label id pre-filtered along with other languages of choice at the bottom section of the editor. I can change the translation text in different languages using the editor. Refer screenshot #3.
  4. In Dynamics AX, the label texts are stored in text files with label id and separated by a tab. Label ids always begin with @ symbol. Here in the example shown @SYS is the group prefix and the given number is a sequential index. Refer screenshot #4 that displays text found in an en-us label file.

I understand that this is similar to Resource editor in Visual Studio where the translation text are stored in .resx files for each language. I would like to do something similar for an ASP.NET MVC 3 application using SQL Server database as the data store for the translation text.

Here are my questions:

  1. What would I need to create in Visual Studio 2010 to achieve this functionality so I can invoke the translation editor in the IDE? Would that be a plugin or extension?

  2. Would a similar resource provider be possible to do in an ASP.NET MVC application, where I can just specify the label id within double quotes and have provider model fetch the data from database during runtime? Is the syntax Resources.MyResource.GetLabel("@SYS67"); the only available option in ASP.NET? Sorry, if the resources syntax is wrong.

  3. Are there any similar tool set (plugin/extension) already available for Visual Studio?

  4. I believe that one of the terms to do translation in ASP.NET application is making use of Resource Provider Model. Are there any other terms? I am interested to know the term of what I am trying to achieve so I can search on the web to read more about it.

Any inputs will be really appreciated.

Thanks in advance.

Screenshot #1:

1

Screenshot #2:

2

Screenshot #3:

3

Screenshot #4:

4

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

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

发布评论

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

评论(1

红ご颜醉 2024-11-17 06:05:29

我要跳到这里告诉你我所知道的。如果它不能完全回答您的问题,我深表歉意,但我不想偏离我熟悉的内容太远,从而给您提供不好的建议。

从您描述问题的方式来看,您似乎可以使用资源文件(RESX)进行翻译,问题更多的是您想知道如何以用户友好的方式编辑它们。此外,一些用户可能想要在网络上编辑翻译。

要回答这部分问题,我建议您查看这篇文章:

http://blog.lavablast.com/post/2008/02/07/RESX-file-Web-Editor.aspx

作者似乎和您有类似的问题结论作者得出的结论与您的想法相似。提供了源代码,因此如果您想采用此方法,您可以抢占先机。

如果您打算推出自己的编辑器,我建议您选择一种界面并坚持使用。否则,您将增加非实际产品的开发时间。由于您希望为某些用户提供网络,因此我建议您坚持为所有人提供网络。但是,如果您确实想寻求 Visual Studio 的插件,我建议您将尽可能多的代码放入中央业务逻辑层,以便表示层不会占用您太多时间。

但它们在本地化方面都做得很好:

如果您想学习更多关于关于本地化的术语和实践,我推荐以下站点:

http:// Quickstarts.asp.net/QuickStartv20/aspnet/doc/localization/localization.aspx

如果您想将信息存储在数据库而不是 .resx 文件中,这里有一个资源这将向您展示如何执行此操作:

http://msdn.microsoft.com/ en-us/library/aa905797.aspx

I'm going to jump in here and give you what I know. I apologize if it doesn't completely answer your question but I don't want to stray too far from what I am familiar with and thus give you bad advice.

From the way you describe your issue, it seems that you could use the resource files (RESX) for translations, the issue is more that you want to know how to edit them in a manner that is user friendly. Further, some users may want to edit the translations on the web.

To answer this part of your question, I would recommend that you look at this article:

http://blog.lavablast.com/post/2008/02/07/RESX-file-Web-Editor.aspx

The author seems to have a similar issue as you and the conclusion the author arrived at was similar to what you are thinking about. The source code is provided so you could get a head-start if you wanted to pursue this method.

If you are going to pursue rolling your own editor, I would suggest that you choose one interface and stick with it. Otherwise you will be increasing your development time on something that isn't your actual product. Since you want the web for some users, I would suggest you would stick with the web for everyone. However, if you really want to pursue an plugin for Visual Studio, I would recommend that you put as much code into a central business logic layer as possible so that your presentation layers don't take up much of your time.

As for currently-available options, I don't think any of the following are Visual Studio plugins, but they all do a good job at working with localization:

If you want to learn more about the terminology and practices of localization, I would recommend the following site:

http://quickstarts.asp.net/QuickStartv20/aspnet/doc/localization/localization.aspx

If you want to store information in a database instead of a .resx file, here is a resource that will show you how to do it:

http://msdn.microsoft.com/en-us/library/aa905797.aspx

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