为什么要对应用程序设置使用多个Xml文档? [英] why use multiple Xml documents for app, settings?

查看:49
本文介绍了为什么要对应用程序设置使用多个Xml文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我有一项任务,要求我将默认语言设置为从应用程序中获胜.使用xml文件
现在没问题"

hello,
I have got an assignment which requires me to set default languauge to a win from app. using an xml file
now that''s no problem "

<languages>
<language id="english" mark="">
<control id="ctrl1">Button_One</control>
<control id="ctrl2">Button_Tow</control>
<control id="ctrl3">Button_Three</control>
<control id="ctrl4">Button_Four</control>
</language>
<language id="hebrew" mark="defualt">
<control id="ctrl1">כפתור_אחד</control>
<control id="ctrl2">כפתור_שני</control>
<control id="ctrl3">כפתור_שלישי</control>
<control id="ctrl4">כפתור_רביעי</control>
</language>
<language id="spanish" mark="">
<control id="ctrl1">botón uno</control>
<control id="ctrl2">botón también</control>
<control id="ctrl3">botón tres</control>
<control id="ctrl4">botón cuatro</control>
</language>
</languages>


作业还指出,我们可以使用多个xml文件,每种语言使用一个,
我的问题是:
以这种方式而不是像我一样在一个文件中这样做的好处是什么?


the assignment also stated that we may use several xml files, one for each language,
my question is:
what could be the advantage of doing this in that manner ,and not in one file as I have ?

推荐答案

语言xml将使您的应用程序可插入.这将帮助您维护并在将来以最小的努力支持任何新语言.

如果将所有语言合而为一,则可能需要更改代码并进行相应处理.此外,维护将很困难.
Keeping a design or code such that it just expects a particular language xml would make your application pluggable. This would help you in maintanece and supporting any new language in future with minimal effort.

If you keep all the langauges in one, you might need to change code and handle accordingly. Further, maintaence would be difficult.


所有这些看起来都像是天真地尝试使用原始的自制方法来实现可本地化的应用程序.这不好,您不应该这样做.

(而且请不要告诉我您有完成任务的能力.软件开发人员的一项主要技能是能够发现错误的任务并进行报告,直到您确定自己做得合理为止.)

.NET提供了一套全面的方法来实现应用程序的全球化和本地化,甚至不修改原始的应用程序代码.这是您应该使用的.

从这里开始: http://msdn.microsoft.com/en-us/goglobal/bb688139 [ ^ ].

—SA
It all looks like a wildly naive attempt to achieve localizeable application using primitive home-baked methods. This is not good, you should not do it.

(And please don''t tell me you have assignment to do exactly that. A major skill of software developers is the ability to spot incorrect assignments and report back until you make sure you do reasonable job.)

.NET offers comprehensive set of methods to achieve globalization and localization of applications not even re-touching original application code. This is what you should use.

Start from here: http://msdn.microsoft.com/en-us/goglobal/bb688139[^].

—SA


这篇关于为什么要对应用程序设置使用多个Xml文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆