# 属性文件

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/zh-cn/help/go/llms.txt).

Properties files  是具有  `.properties`  扩展名的文本文件，包含以键值对形式存储的本地化字符串，可以在用户界面中访问和渲染。

GoLand 用以下图标标记这些文件： ![属性文件](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.fileTypes.editorConfig.svg)。

GoLand 也识别 XML 格式的属性文件。 它们标有图标 ![XML properties 文件](https://resources.jetbrains.com/help/img/idea/2026.3/properties.icons.xmlProperties.svg)。

可以将多个具有相同基础名称和特定语言后缀的属性文件组合成一个 [resource bundle](resource-bundle.html)，以便使用。

Procedure: 创建一个 properties 文件

1. 从目标目录的上下文菜单中选择  `新建文件` 。

2. 在   新建文件  对话框中，输入带有相应扩展名的文件名  `.properties` ，然后点击   确定  。

## 属性文件的编码

Procedure: 配置属性文件的默认编码

1. 在   设置  对话框( `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Comma` (VSCode), `⌘ Comma` (VSCode (macOS)))中，选择  `编辑器 | 文件编码` 。

2. 从   属性文件的默认编码方式设置  列表中选择编码。

3. 如有必要，启用   透明的本地到 ASCII 转换   以显示本地字符（即未在 [ISO-8859-1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1) 中定义的字符），以替代相应的转义序列。

![默认的 Properties 文件编码设置](https://resources.jetbrains.com/help/img/idea/2026.3/default_properties_file_encoding_setting.png)

![转换为转义序列的检查](https://resources.jetbrains.com/help/img/idea/2026.3/convert_to_escape_sequences.png)

