macos:File-formats-and-filename-ext
出自UXGuide.net
请帮助我们修订和更新本文的中文部分
本文的中文部分虽然取自官方最新中文版本,但与英文原版相比已落后了一年多,可能无法反映英文版本中最近的修改,且文中笔误、前后译法矛盾、未翻译完全的片断较多,请您帮助一起修订完善。详情参见中文版修订完善计划。
文件格式和文件扩展名
File Formats and Filename Extensions
Whenever possible, include support for industry-standard file formats in your documents. Supporting standard file formats makes it easier to exchange data between your application and other applications. Users might also be more inclined to use your application if they know they can get their data into and out of it easily.
尽可能在您的程序中支持标准的文件格式,从而更容易和其他的程序进行数据交换。如果用户可以轻易导入和导出数据的话,用户会更倾向于使用您的产品。
When saving user-configurable data, make sure you store it in a plain-text file that the user can modify. Mac OS X applications traditionally store configuration data using XML. You can write out XML data using the preferences system and the XML support found in Core Foundation and Cocoa. For information about user preferences, see Runtime Configuration Guidelines.
确保将用户的配置数据保存成纯文本文件从而用户可以修改它。Mac OS X上的程序的配置数据通常使用XML格式保存。您可以使用偏好设置系统和Core Foundation及Cocoa中的XML API来读写XML数据。关于用户配置的更多信息,请参考运行时系统配置指南。
Many platforms rely on the existence of filename extensions to identify the type of a file. Although many longtime Mac OS X developers may decry their use, filename extensions make it easier for users to exchange files with users of those other platforms. Applications that save documents should be sure to include a filename extension appropriate to the contents of the document. At the same time, however, applications should take care to respect the user's filename extension preferences when displaying the names of files and documents.
很多平台都依赖于文件的扩展名来判断文件类型。尽管很多Mac OS X程序员对此不屑一顾,但是文件扩展名使得用户在多个平台间更容易的进行文件交换。确保的您的程序在保存文件时附加了正确的扩展名,同时,在显示文件名时,要注意用户的文件扩展名偏好设置。
For more information and guidelines about supporting filename extensions, see File System Overview.
关于扩展名支持的更多信息,请参考文件系统概述。