有人知道xcode文件“InfoPlist.strings(英文)"是什么吗?是? [英] Does anybody know what the xcode file "InfoPlist.strings (English)" is?

查看:18
本文介绍了有人知道xcode文件“InfoPlist.strings(英文)"是什么吗?是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道InfoPlist.strings 文件是干什么用的?它在 Xcode 3.2 中.它是 Applescript 中的 Cocoa 应用程序.

Does anyone know what the file InfoPlist.strings is for? It is in Xcode 3.2. It is a Cocoa app in Applescript.

推荐答案

信息属性列表文件是一个结构化的文本文件包含捆绑可执行文件的基本配置信息.文件本身通常使用 Unicode UTF-8 编码并且内容是使用 XML 结构化的.根 XML 节点是一个字典,其内容是一组描述捆绑的不同方面.系统使用这些键和值获取有关您的应用程序及其配置方式的信息.作为一个结果,所有捆绑的可执行文件(插件、框架和应用程序)都是预计会有一个信息属性列表文件.

An information property list file is a structured text file that contains essential configuration information for a bundled executable. The file itself is typically encoded using the Unicode UTF-8 encoding and the contents are structured using XML. The root XML node is a dictionary, whose contents are a set of keys and values describing different aspects of the bundle. The system uses these keys and values to obtain information about your app and how it is configured. As a result, all bundled executables (plug-ins, frameworks, and apps) are expected to have an information property list file.

按照惯例,信息属性列表文件的名称是信息.plist.

By convention, the name of an information property list file is Info.plist.

本地化的值不存储在 Info.plist 文件本身中.相反,您将特定本地化的值存储在名为 InfoPlist.strings 的字符串文件.你把这个文件放在用于存储的相同语言特定项目目录相同本地化的其他资源.的内容InfoPlist.strings 文件是您想要本地化和适当翻译的值.查找key的例程Info.plist 文件中的值采用用户的语言首选项考虑并返回密钥的本地化版本(来自适当的 InfoPlist.strings 文件)存在时.如果本地化键的版本不存在,例程返回存储的值在 Info.plist 文件中.

Localized values are not stored in the Info.plist file itself. Instead, you store the values for a particular localization in a strings file with the name InfoPlist.strings. You place this file in the same language-specific project directory that you use to store other resources for the same localization. The contents of the InfoPlist.strings file are the individual keys you want localized and the appropriately translated value. The routines that look up key values in the Info.plist file take the user’s language preferences into account and return the localized version of the key (from the appropriate InfoPlist.strings file) when one exists. If a localized version of a key does not exist, the routines return the value stored in the Info.plist file.

例如,TextEdit 应用程序有几个键显示在Finder,因此应该本地化.假设你的信息属性列表文件定义了以下键:

For example, the TextEdit app has several keys that are displayed in the Finder and thus should be localized. Suppose your information property list file defines the following keys:

<key>CFBundleDisplayName</key> 
<string>TextEdit</string>
<key>NSHumanReadableCopyright</key> 
<string>Copyright © 1995-2009, Apple Inc.,All Rights Reserved.</string> 

法语本地化TextEdit 然后在 InfoPlist.strings 中包含以下字符串其Contents/Resources/French.lproj目录下的文件:

The French localization for TextEdit then includes the following strings in the InfoPlist.strings file of its Contents/Resources/French.lproj directory:

CFBundleDisplayName = "TextEdit";
NSHumanReadableCopyright = "Copyright © 1995-2009 Apple Inc.\nTous droits réservés.";

来自 developer.Apple.com

这篇关于有人知道xcode文件“InfoPlist.strings(英文)"是什么吗?是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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