本地化 dbms 演示数据
我正在开发一个 Windows 移动应用程序,它应该支持多种语言(英语、德语、法语、俄语)。
该应用程序即将向客户(德国人、俄罗斯人等)展示,我们希望根据其设置的文化生成数据。
那么:有没有人想到一种方法来创建将在运行时插入到数据库管理系统中的数据?
例如:英语版本的增值税描述为“VAT 17.5%”,值为 17.5,德语版本为“Mehrwertsteuer 19%”,值为 19,法语版本为“TVA 19.6%”,值为 19.6
提前致谢
编辑
我承认我不是很清楚。我需要一组数据进行本地化。我需要一种机制,以某种方式读取这个“准备好的”本地化数据并插入到数据库管理系统中。
我的第二个想法是使用一个对所有语言都具有相同结构的 XML 文件(当然值不同),例如
datafile.en-US.xml
datafile.de-DE.xml
您对此有何看法?
I'm developing a windows mobile application which should work in multiple languages (English, German, French, Russian).
This application is about to be shown to customers (Germans, Russians,...) and we would like to generate data depending on the culture it is setup for.
So: has anybody thought of a way to create data which than is about to be inserted into the dbms at runtime?
For example: tha VAT description for the english version reads "VAT 17.5%" with value 17.5, the german version "Mehrwertsteuer 19%" with value 19, the french version "TVA 19.6%" with value 19.6
Thanks in advance
EDIT
I admit i was not very clear. I need a set of data to be localized. I need a mechanism which somehow reads this "prepared" localized data and inserts into the dbms.
A second thought of mine would be to use a XML file which has the same structure for all the languages (but of course different values), e.g
datafile.en-US.xml
datafile.de-DE.xml
What do you think about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不太清楚你的目标是什么,所以我可能会弄错...无论如何,如果你计划在不同的国家/地区分发 Windows Mobile 客户端应用程序,并且一种语言版本要在一个国家/地区使用,我建议使用资源文件而不是 SQL DB。您可以放置“VAT {0}”、“TVA {0}”等消息并在运行时对其进行格式化(根据编程语言,它看起来会有所不同,请参阅下面的 C#/.Net 示例),保留有效的文化格式。
如果您仍然需要将增值税值添加到 SQL 中以供参考,则只需添加一个小数列即可保存增值税表的外键或仅保存增值税值...
更新不同的增值税值
问题就是说,增值税值不仅因国家/地区而异,而且还取决于您购买的商品...因此需要以可配置的方式存储它们...好吧,如果您想使用 SQL DB,您可以使用附加的增值税表PK 跨越两列:一个 CountryID(FK 表示国家/地区表)和第二个 RateID(整数),两者都唯一标识该国家/地区的给定增值税率...
I don't quite know what is your aim, so I could be mistaken here... Anyway, if you planning to distribute your Windows Mobile client application across various countries and one language version is to work in one country, I would suggest using resource files instead SQL DB. You could put messages like "VAT {0}", "TVA {0}" and format them at runtime (depending on programming language it would look different, please find C#/.Net example below) preserving valid cultural format.
If you still need to add VAT value to SQL for reference, you can simply add one decimal column which will hold either foreign key to VAT table or simply VAT value...
Update on different VAT values
The problem is that, VAT values differs not only by countries but also depending on what you purchase... Therefore one need to store them in configurable way... Well, if you want to go with SQL DB, you could use additional VAT table with PK spanned across two columns: one CountryID (FK for Country table) and the second RateID (Integer) both uniquely identifying given VAT rate for the country...