<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>iTopCN – 定制化 iTop</title><link>/docs/customization/</link><description>Recent content in 定制化 iTop on iTopCN</description><generator>Hugo -- gohugo.io</generator><language>zh</language><lastBuildDate>Fri, 27 Jun 2025 00:00:00 +0000</lastBuildDate><atom:link href="/docs/customization/index.xml" rel="self" type="application/rss+xml"/><item><title>Docs: 翻译</title><link>/docs/customization/translations/</link><pubDate>Sun, 03 Sep 2023 00:00:00 +0000</pubDate><guid>/docs/customization/translations/</guid><description>
&lt;div class="pageinfo pageinfo-primary">
&lt;p>本文档介绍 iTop 的翻译机制，包括字典文件格式、命名约定以及如何为现有语言贡献翻译。更多详细内容请参考 &lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:translation">iTop 官方文档&lt;/a>。&lt;/p>
&lt;/div>
&lt;h2 id="原则">原则&lt;/h2>
&lt;p>在 iTop 和 iTop 模块中，语言由两个要素确定：&lt;/p>
&lt;ul>
&lt;li>ISO 639-1 语言代码。例如：&lt;code>pt&lt;/code> 表示葡萄牙语。&lt;/li>
&lt;li>ISO 国家代码。例如：&lt;code>br&lt;/code> 表示巴西。&lt;/li>
&lt;/ul>
&lt;p>本地化依赖于字典文件，这些文件的名称以小写语言代码作为前缀，例如：&lt;code>pt_br.dictionary.itop.core.php&lt;/code>。这些文件是数据模型的一部分，因此在每次修改后都需要进行编译（重新运行安装或使用工具包）。&lt;/p>
&lt;p>在 iTop 中，嵌入的字典文件位于以下位置：&lt;/p>
&lt;ul>
&lt;li>&lt;code>&amp;lt;itop-root&amp;gt;/dictionaries/&lt;/code>&lt;/li>
&lt;li>&lt;code>&amp;lt;itop-root&amp;gt;/datamodels/2.x/&amp;lt;module&amp;gt;/dictionaries&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>在模块中，这些文件位于模块的根目录。&lt;/p>
&lt;p>自 iTop 3.0.0（N°2969）起，模块的字典文件可以位于模块的根文件夹或名为 &lt;code>dictionaries&lt;/code> 的子文件夹中。&lt;/p>
&lt;p>出于兼容性原因，作为扩展分发的模块保留了它们的字典文件在根文件夹中的方式，但 iTop 核心模块（datamodels/2.x）已经进行了修改。&lt;/p>
&lt;h2 id="字典文件格式">字典文件格式&lt;/h2>
&lt;p>字典实际上是一个 PHP 文件。它必须以 UTF-8 字符集编码（这是必须的）。我们建议像下面的示例一样省略 PHP 的结束标记：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-php" data-lang="php">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ce5c00;font-weight:bold">&amp;lt;?&lt;/span>&lt;span style="color:#000">php&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic">/**
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"> * Localized data
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"> *
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"> * @copyright Copyright (C) 2015 John Foo Ltd
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"> * @author John Foo (john@foo.com)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"> * @license http://opensource.org/licenses/AGPL-3.0
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic"> */&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">Dict&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">::&lt;/span>&lt;span style="color:#c4a000">Add&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>&lt;span style="color:#4e9a06">&amp;#39;PT BR&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Brazilian&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Portuguese&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#204a87;font-weight:bold">array&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;Menu:ChangeManagement&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Gerenciamento Mudanças&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;Menu:Change:Overview&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Visão geral&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;Menu:NewChange&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;New Change~~&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">));&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>注意事项：&lt;/p>
&lt;ul>
&lt;li>函数调用的第一个参数是大写的语言代码。&lt;/li>
&lt;li>函数调用的第二个参数是英语中的语言名称。&lt;/li>
&lt;li>函数调用的第三个参数是目标语言中的语言名称。&lt;/li>
&lt;li>&lt;code>Dict::Add&lt;/code> 函数的行在所有相同语言的字典文件中必须相同（是的，这里有冗余信息）。&lt;/li>
&lt;li>请注意某些字符串末尾的 &lt;code>~~&lt;/code>。这个后缀不会显示给最终用户。它由 Combodo 在发布新版本时添加，用于显示哪些新字符串需要翻译。&lt;/li>
&lt;/ul>
&lt;h2 id="一些通用规则">一些通用规则&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>保持一致性：&lt;/strong> 重复使用已经翻译的术语（例如，&amp;ldquo;经理&amp;quot;是许多关键词中使用的词汇）。&lt;/li>
&lt;li>&lt;strong>英文术语：&lt;/strong> 如果在上下文中更容易理解，可以保留英文术语。&lt;/li>
&lt;li>&lt;strong>避免过于口语化的表述：&lt;/strong> iTop 是一款既被公司使用又被其客户使用的产品。&lt;/li>
&lt;li>&lt;strong>不要硬编码 &amp;ldquo;iTop&amp;rdquo; 名称：&lt;/strong> 使用常量（它们在 &lt;code>core/config.class.inc.php&lt;/code> 中定义）：
&lt;ul>
&lt;li>&lt;code>ITOP_APPLICATION&lt;/code>：应用程序包的完整名称，例如 &amp;ldquo;iTop Community&amp;rdquo; 或 &amp;ldquo;iTop Professional&amp;rdquo;。&lt;/li>
&lt;li>&lt;code>ITOP_APPLICATION_SHORT&lt;/code>：应用程序的名称，例如 &amp;ldquo;iTop&amp;rdquo;。&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>类名命名方式：&lt;/strong> 使用驼峰命名法。&lt;/li>
&lt;li>&lt;strong>数据模型项目命名标准：&lt;/strong> &lt;code>Class:&amp;lt;classname&amp;gt;&lt;/code>、&lt;code>Class:&amp;lt;classname&amp;gt;/Attribute:&amp;lt;fieldname&amp;gt;&lt;/code>。例如：&lt;code>Class:Ticket&lt;/code>、&lt;code>Class:Ticket/Attribute:ref&lt;/code>、&lt;code>Class:UserRequest/Attribute:status/Value:new&lt;/code>。&lt;/li>
&lt;li>&lt;strong>字段标签翻译：&lt;/strong> 请在定义字段的类中进行翻译，而不是在子类中进行。例如，对于 &lt;code>Class:Ticket/Attribute:ref&lt;/code> 是可以的，但对于 &lt;code>Class:Change/Attribute:ref&lt;/code> 则不应该。如果需要后者，可以使用自定义模块将其添加到您的 iTop 实例中。&lt;/li>
&lt;li>&lt;strong>操作标签中的类别：&lt;/strong> 尽量不要在通用用户的操作标签中提及类别。但对于管理员用户可以这样做。如果使用类别标签，请将其大写化，例如将 &amp;ldquo;notification&amp;rdquo; 改为 &amp;ldquo;Notification&amp;rdquo;。&lt;/li>
&lt;li>&lt;strong>特殊条目 &lt;code>Class:&amp;lt;classname&amp;gt;/Attribute:friendlyname&lt;/code>：&lt;/strong> 在英文中显示为 &amp;ldquo;Full name&amp;rdquo;，如果没有翻译，它不对应于特定的类字段，而是对应于用作外部键、对象列表和对象详情中的对象标签的魔法属性。&lt;/li>
&lt;/ul>
&lt;p>这些规则有助于维护和确保翻译的一致性。&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>键语法&lt;/th>
&lt;th>用途&lt;/th>
&lt;th>示例&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Class:&amp;lt;classname&amp;gt;&lt;/code>&lt;/td>
&lt;td>翻译类的&lt;strong>名称&lt;/strong>&lt;/td>
&lt;td>&lt;code>Class:Ticket&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Class:&amp;lt;classname&amp;gt;/Attribute:&amp;lt;fieldname&amp;gt;&lt;/code>&lt;/td>
&lt;td>翻译字段&lt;strong>标签&lt;/strong>&lt;/td>
&lt;td>&lt;code>Class:Ticket/Attribute:ref&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Class:&amp;lt;classname&amp;gt;/Attribute:&amp;lt;fieldname&amp;gt;/Value:&amp;lt;value&amp;gt;&lt;/code>&lt;/td>
&lt;td>翻译枚举属性的&lt;strong>值&lt;/strong>&lt;/td>
&lt;td>&lt;code>Class:UserRequest/Attribute:status/Value:new&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>Class:&amp;lt;classname&amp;gt;/Attribute&lt;/code>&lt;/td>
&lt;td>格式化友好名称&lt;strong>值&lt;/strong>（参见下方示例）&lt;/td>
&lt;td>&lt;code>'Class:Person/Name' =&amp;gt; '%2$s %1$s'&lt;/code>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="friendlyname-语法">Friendlyname 语法&lt;/h3>
&lt;p>在这个示例中：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-php" data-lang="php">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:Person/Name&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;%2$s, %1$s&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#8f5902;font-style:italic">/* 示例：&amp;#34;Christie, Agatha&amp;#34; */&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>&lt;code>%1$s&lt;/code> 对应于 &lt;code>Person&lt;/code> 类的命名 XML 标签中的第一个字段，因此是 &lt;code>first_name&lt;/code>。&lt;/li>
&lt;li>&lt;code>%2$s&lt;/code> 对应于 &lt;code>Person&lt;/code> 类的命名 XML 标签中的第二个字段，因此是 &lt;code>name&lt;/code>。&lt;/li>
&lt;/ul>
&lt;p>这允许指定不同的顺序，甚至一些其他字符和分隔符。&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-xml" data-lang="xml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#204a87;font-weight:bold">&amp;lt;classes&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;lt;class&lt;/span> &lt;span style="color:#c4a000">id=&lt;/span>&lt;span style="color:#4e9a06">&amp;#34;Person&amp;#34;&lt;/span>&lt;span style="color:#204a87;font-weight:bold">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;lt;properties&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;lt;naming&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;lt;attributes&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;lt;attribute&lt;/span> &lt;span style="color:#c4a000">id=&lt;/span>&lt;span style="color:#4e9a06">&amp;#34;first_name&amp;#34;&lt;/span>&lt;span style="color:#204a87;font-weight:bold">/&amp;gt;&lt;/span> &lt;span style="color:#8f5902;font-style:italic">&amp;lt;!-- 映射到 %1$s --&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;lt;attribute&lt;/span> &lt;span style="color:#c4a000">id=&lt;/span>&lt;span style="color:#4e9a06">&amp;#34;name&amp;#34;&lt;/span>&lt;span style="color:#204a87;font-weight:bold">/&amp;gt;&lt;/span> &lt;span style="color:#8f5902;font-style:italic">&amp;lt;!-- 映射到 %2$s --&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;lt;/attributes&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#204a87;font-weight:bold">&amp;lt;/naming&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="字典关键词的命名约定">字典关键词的命名约定&lt;/h2>
&lt;p>新条目的命名应根据其领域和目的，从最不具体的信息开始命名。&lt;/p>
&lt;p>最常用的分隔符是 &lt;code>:&lt;/code>，但也可以找到 &lt;code>/&lt;/code> 和 &lt;code>-&lt;/code>。&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-php" data-lang="php">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Core:BulkExport:TextFormat&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Text fields containing some HTML markup&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;UI:CSVImport:TextQualifierCharacter&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Text qualifier character&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;DayOfWeek-Sunday-Min&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Su&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>使用后缀来定义相同标签的变种：&lt;/p>
&lt;ul>
&lt;li>&lt;code>+&lt;/code> 表示短描述（通常显示在工具提示中）&lt;/li>
&lt;li>&lt;code>?&lt;/code> 表示帮助/解释（可以跨多行）&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-php" data-lang="php">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Core:SynchroAtt:update&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Update ?&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Core:SynchroAtt:update+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Used to update the object&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;UI:CSVImport:AdvancedMode&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Advanced mode&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;UI:CSVImport:AdvancedMode+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;In advanced mode the &amp;#34;id&amp;#34; (primary key) of the objects can be used to update and rename objects.&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ce5c00;font-weight:bold">.&lt;/span>&lt;span style="color:#4e9a06">&amp;#39;However the column &amp;#34;id&amp;#34; (if present) can only be used as a search criteria&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ce5c00;font-weight:bold">.&lt;/span>&lt;span style="color:#4e9a06">&amp;#39; and can not be combined with any other search criteria.&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>当建立了命名约定后，标识符应该指定为 &lt;code>&amp;lt;name&amp;gt;:&amp;lt;value&amp;gt;&lt;/code>，就像以下示例中的方式：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-php" data-lang="php">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:Event/Attribute:date&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Date&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:Event/Attribute:date+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;date and time at which the changes have been recorded&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>请注意，在这种情况下，分隔符应该是 &lt;code>/&lt;/code>。&lt;/p>
&lt;h3 id="枚举值">枚举值&lt;/h3>
&lt;p>枚举或枚举集的值使用自己的语法：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-php" data-lang="php">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:Action/Attribute:status/Value:test&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Being tested&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:Action/Attribute:status/Value:test+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Action has maybe a different behavior than when in production&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:Action/Attribute:status/Value:enabled&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;In production&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:Action/Attribute:status/Value:enabled+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:Action/Attribute:status/Value:disabled&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Inactive&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:Action/Attribute:status/Value:disabled+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Action is not effective&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="实体覆盖">实体覆盖&lt;/h3>
&lt;p>子类可以覆盖属性（或值）的标签/工具提示，即使该属性已在其父类之一中定义。&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-php" data-lang="php">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:ActionEmail/Attribute:status/Value:test+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Only the Test recipient is notified&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:ActionEmail/Attribute:status/Value:enabled+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;All To, Cc and Bcc emails are notified&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:ActionEmail/Attribute:status/Value:disabled+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;The email notification will not be sent&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;Class:ActionEmail/Attribute:test_recipient&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Test recipient&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="关系">关系&lt;/h3>
&lt;p>默认链接相关的操作/图标工具提示、弹出窗口标题和确认消息如下所示。&lt;/p>
&lt;p>它们可以根据需要进行自定义，甚至可以根据类别/关联设置属性进行定制化（请参阅下文）。&lt;/p>
&lt;h4 id="1n-关系">1:n 关系&lt;/h4>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>通用字典条目代码&lt;/th>
&lt;th>用途&lt;/th>
&lt;th>英文&lt;/th>
&lt;th>法文&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>UI:Links:Create:Button+&lt;/code>&lt;/td>
&lt;td>列表右上角的&lt;strong>加号图标&lt;/strong>工具提示&lt;/td>
&lt;td>Create a %4$s&lt;/td>
&lt;td>Créer un(e) %4$s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:Create:Modal:Title&lt;/code>&lt;/td>
&lt;td>&lt;strong>子对象创建&lt;/strong>弹出窗口标题&lt;/td>
&lt;td>Create a %4$s in %2$s&lt;/td>
&lt;td>Ajouter un(e) %4$s à %2$s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:ModifyObject:Button+&lt;/code>&lt;/td>
&lt;td>行右端的&lt;strong>铅笔图标&lt;/strong>工具提示&lt;/td>
&lt;td>Modify this object&lt;/td>
&lt;td>Modifier cet objet&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:ModifyObject:Modal:Title&lt;/code>&lt;/td>
&lt;td>&lt;strong>子对象修改&lt;/strong>弹出窗口标题&lt;/td>
&lt;td>Modify %5$s&lt;/td>
&lt;td>Modifier %5$s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:Remove:Button+&lt;/code>&lt;/td>
&lt;td>行右端的&lt;strong>减号图标&lt;/strong>工具提示&lt;/td>
&lt;td>Remove this %4$s&lt;/td>
&lt;td>Retirer cet(te) %4$s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:Remove:Modal:Title&lt;/code>&lt;/td>
&lt;td>&lt;strong>子对象从其宿主中移除&lt;/strong>弹出窗口标题&lt;/td>
&lt;td>Remove a %4$s from its %1$s&lt;/td>
&lt;td>Retirer un(e) %4$s de son/sa %1$s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:Remove:Modal:Message&lt;/code>&lt;/td>
&lt;td>&lt;strong>子对象移除&lt;/strong>的确认消息&lt;/td>
&lt;td>Do you really want to remove %5$s from %2$s?&lt;/td>
&lt;td>Voulez vous vraiment retirer %5$s de %2$s ?&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:Delete:Button+&lt;/code>&lt;/td>
&lt;td>行右端的&lt;strong>垃圾桶图标&lt;/strong>工具提示&lt;/td>
&lt;td>Delete this %4$s&lt;/td>
&lt;td>Supprimer cet(te) %4$s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:Delete:Modal:Title&lt;/code>&lt;/td>
&lt;td>&lt;strong>子对象删除&lt;/strong>弹出窗口标题&lt;/td>
&lt;td>Delete a %4$s&lt;/td>
&lt;td>Supprimer un(e) %4$s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:Delete:Modal:Message&lt;/code>&lt;/td>
&lt;td>&lt;strong>子对象删除&lt;/strong>的确认消息&lt;/td>
&lt;td>Do you really want to delete %5$s?&lt;/td>
&lt;td>Voulez vous vraiment supprimer %5$s ?&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h4 id="nn-关系">n:n 关系&lt;/h4>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>通用字典条目代码&lt;/th>
&lt;th>用途&lt;/th>
&lt;th>英文&lt;/th>
&lt;th>法文&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>UI:Links:Add:Button+&lt;/code>&lt;/td>
&lt;td>列表右上角的&lt;strong>加号图标&lt;/strong>工具提示&lt;/td>
&lt;td>Add a %4$s&lt;/td>
&lt;td>Ajouter un %4$s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:Add:Modal:Title&lt;/code>&lt;/td>
&lt;td>&lt;strong>链接创建&lt;/strong>弹出窗口标题&lt;/td>
&lt;td>Add a %4$s to %2$s&lt;/td>
&lt;td>Ajouter un %4$s à %2$s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:ModifyLink:Button+&lt;/code>&lt;/td>
&lt;td>行右端的&lt;strong>铅笔图标&lt;/strong>工具提示&lt;/td>
&lt;td>Modify this link&lt;/td>
&lt;td>Modifier cette relation&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:ModifyLink:Modal:Title&lt;/code>&lt;/td>
&lt;td>&lt;strong>链接修改&lt;/strong>弹出窗口标题&lt;/td>
&lt;td>Modify the link between %2$s and %5$s&lt;/td>
&lt;td>Modifier la relation entre %2$s et %5$s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:Remove:Button+&lt;/code>&lt;/td>
&lt;td>行右端的&lt;strong>减号图标&lt;/strong>工具提示&lt;/td>
&lt;td>Remove this %4$s&lt;/td>
&lt;td>Retirer ce %4$s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:Remove:Modal:Title&lt;/code>&lt;/td>
&lt;td>&lt;strong>链接删除&lt;/strong>弹出窗口标题&lt;/td>
&lt;td>Remove a %4$s&lt;/td>
&lt;td>Retirer un %4$s&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>UI:Links:Remove:Modal:Message&lt;/code>&lt;/td>
&lt;td>&lt;strong>链接删除&lt;/strong>的确认消息&lt;/td>
&lt;td>Do you really want to remove %5$s from %2$s?&lt;/td>
&lt;td>Voulez vous vraiment retirer %5$s de %2$s ?&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h5 id="占位符">占位符&lt;/h5>
&lt;ul>
&lt;li>&lt;strong>$%1s&lt;/strong>：宿主对象类名称（本地化）&lt;/li>
&lt;li>&lt;strong>$%2s&lt;/strong>：宿主对象友好名称&lt;/li>
&lt;li>&lt;strong>$%3s&lt;/strong>：宿主对象内的当前标签名称（本地化）&lt;/li>
&lt;li>&lt;strong>$%4s&lt;/strong>：远程对象类名称（本地化）&lt;/li>
&lt;li>&lt;strong>$%5s&lt;/strong>：远程对象友好名称（注意：并非所有情况下都可用，需要检查！）&lt;/li>
&lt;/ul>
&lt;h5 id="专用化">专用化&lt;/h5>
&lt;p>除非为给定类的特定 LinkedSet（或 LinkedSetIndirect）属性定义了更具体的条目，否则使用上面的通用条目代码。&lt;/p>
&lt;p>以下是考虑法语中类别属性的覆盖逻辑示例：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-php" data-lang="php">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">Dict&lt;/span>&lt;span style="color:#ce5c00;font-weight:bold">::&lt;/span>&lt;span style="color:#c4a000">Add&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>&lt;span style="color:#4e9a06">&amp;#39;FR FR&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;French&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Français&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span> &lt;span style="color:#204a87;font-weight:bold">array&lt;/span>&lt;span style="color:#000;font-weight:bold">(&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;Class:Person/Attribute:team_list/UI:Links:Add:Button+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Ajouter une %4$s&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;Class:Person/Attribute:team_list/UI:Links:Add:Modal:Title&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Ajouter une %4$s à %2$s&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;Class:Person/Attribute:team_list/UI:Links:Remove:Button+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Retirer cette %4$s&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;Class:Person/Attribute:team_list/UI:Links:Remove:Modal:Title&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Retirer une %4$s&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;Class:Team/Attribute:persons_list/UI:Links:Add:Button+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Ajouter une %4$s&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;Class:Team/Attribute:persons_list/UI:Links:Add:Modal:Title&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Ajouter une %4$s à %2$s&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;Class:Team/Attribute:persons_list/UI:Links:Remove:Button+&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Retirer cette %4$s&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#4e9a06">&amp;#39;Class:Team/Attribute:persons_list/UI:Links:Remove:Modal:Title&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Retirer une %4$s&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000;font-weight:bold">));&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="最终用户门户">最终用户门户&lt;/h3>
&lt;p>如果您添加了一个新的终端用户门户，您可能希望创建一个字典条目，以便为其创建一个真实的标签。要做到这一点，请按照以下语法进行操作：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-php" data-lang="php">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic">// 默认门户
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic">&lt;/span>&lt;span style="color:#4e9a06">&amp;#39;portal:itop-portal&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Standard portal&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;portal:&amp;lt;YOUR_PORTAIL_ID&amp;gt;&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Your new portal label&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="ui-主题">UI 主题&lt;/h3>
&lt;p>如果您为后台创建了一个新主题，您可能希望创建一个字典条目，以便用户在首选项页面中选择它时能够获得一个漂亮的标签。要做到这一点，请按照以下语法进行操作：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-php" data-lang="php">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic">// 默认主题
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8f5902;font-style:italic">&lt;/span>&lt;span style="color:#4e9a06">&amp;#39;theme:fullmoon&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Full Moon 🌕&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4e9a06">&amp;#39;theme:&amp;lt;YOUR_THEME_ID&amp;gt;&amp;#39;&lt;/span> &lt;span style="color:#ce5c00;font-weight:bold">=&amp;gt;&lt;/span> &lt;span style="color:#4e9a06">&amp;#39;Your new theme label&amp;#39;&lt;/span>&lt;span style="color:#000;font-weight:bold">,&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="如何贡献改进现有语言">如何贡献改进现有语言&lt;/h2>
&lt;p>要改进现有语言，您需要执行以下步骤：&lt;/p>
&lt;ol>
&lt;li>
&lt;p>从 &lt;a href="https://github.com/Combodo/iTop">iTop 主存储库&lt;/a> 或相关的模块存储库创建一个分支（Fork）。&lt;/p>
&lt;/li>
&lt;li>
&lt;p>在您的分支上进行修改，并按需改进现有语言的翻译。&lt;/p>
&lt;/li>
&lt;li>
&lt;p>提交拉取请求（Pull Request）：有关详细的提交步骤，请查看您正在修改的存储库中的 CONTRIBUTING.md 文件。GitHub 的帮助页面也提供了关于&lt;a href="https://help.github.com/articles/creating-a-pull-request-from-a-fork/">从分支创建拉取请求&lt;/a>的详细信息。&lt;/p>
&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>为现有语言添加翻译&lt;/strong>：使用 grep 命令查找包含 &lt;code>~~&lt;/code> 的文本，并在原地进行翻译。&lt;/p>
&lt;blockquote>
&lt;p>以下是在 Linux 命令行中查找包含 &lt;code>~~&lt;/code> 标记的德语（de）字典条目的快速命令：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>find -name &lt;span style="color:#4e9a06">&amp;#34;de*dict*.php&amp;#34;&lt;/span> &lt;span style="color:#000;font-weight:bold">|&lt;/span> grep -v &lt;span style="color:#4e9a06">&amp;#34;env-&amp;#34;&lt;/span> &lt;span style="color:#000;font-weight:bold">|&lt;/span> xargs grep &lt;span style="color:#4e9a06">&amp;#34;~~&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>要查找其他语言的字典条目，只需将命令中的 &lt;code>de*&lt;/code> 更改为您想处理的语言代码（例如 fr、it、sp 等），然后从安装 iTop 的目录运行此命令。这将帮助您找到包含 &lt;code>~~&lt;/code> 标记的文本行，以便进行翻译。&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>为新语言添加翻译&lt;/strong>：首先找到您的语言代码和国家代码。然后将英语文件（&lt;code>dictionary.*.php&lt;/code> 或 &lt;code>en.dict.*.php&lt;/code>）复制到相应的目录中，并使用相关的前缀（例如，&lt;code>pt_br.dict…&lt;/code>）。然后对这些文件进行翻译。&lt;/p>
&lt;blockquote>
&lt;p>不要忘记修改 &lt;code>Dict::Add&lt;/code> 函数调用的参数。如果不这样做，将在运行时用您的翻译覆盖英语文本。&lt;/p>
&lt;/blockquote>
&lt;p>提交的拉取请求将由 Combodo 的维护人员进行分析，并最终合并到原始存储库中。&lt;/p>
&lt;hr>
&lt;p>原文：&lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:translation">https://www.itophub.io/wiki/page?id=3_2_0:customization:translation&lt;/a>&lt;/p>
&lt;p>版本：3_2_0/customization/translation.txt · Last modified: 2024/09/10 10:25 by 127.0.0.1&lt;/p></description></item><item><title>Docs: How to 示例</title><link>/docs/customization/how-to/</link><pubDate>Fri, 27 Jun 2025 00:00:00 +0000</pubDate><guid>/docs/customization/how-to/</guid><description>
&lt;p>{% pageinfo %}
本文档介绍 How to 示例。更多详细内容请参考 &lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:start#how_to_examples">iTop 官方文档&lt;/a>。
{% /pageinfo %}&lt;/p>
&lt;h2 id="概述">概述&lt;/h2>
&lt;p>How to 示例 是 iTop 定制中的常见场景。&lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:start#how_to_examples">iTop 官方文档&lt;/a>&lt;/li>
&lt;/ul>
&lt;hr>
&lt;p>原文：&lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:start#how_to_examples">https://www.itophub.io/wiki/page?id=3_2_0:customization:start#how_to_examples&lt;/a>&lt;/p>
&lt;p>Last modified: 2026/06/10 17:31 by127.0.0.1&lt;/p>
&lt;p>版本：3_2_0/customization/start.txt · Last modified: 2026/06/10 17:31 by 127.0.0.1&lt;/p></description></item><item><title>Docs: 编写自己的扩展</title><link>/docs/customization/your-extension/</link><pubDate>Fri, 27 Jun 2025 00:00:00 +0000</pubDate><guid>/docs/customization/your-extension/</guid><description>
&lt;div class="pageinfo pageinfo-primary">
&lt;p>本文档介绍 iTop 定制的整体概览，包括通过安装现有扩展和编写自定义扩展两种方式。更多详细内容请参考 &lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:start">iTop 官方文档&lt;/a>。&lt;/p>
&lt;/div>
&lt;h2 id="定制方式">定制方式&lt;/h2>
&lt;h3 id="安装现有扩展">安装现有扩展&lt;/h3>
&lt;ul>
&lt;li>查看已发布的扩展列表，选择并安装适合您需求的扩展。&lt;/li>
&lt;/ul>
&lt;h3 id="编写自己的扩展">编写自己的扩展&lt;/h3>
&lt;p>创建 iTop 扩展模块的基础知识：&lt;/p>
&lt;ul>
&lt;li>了解 &lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:datamodel">iTop 定制机制&lt;/a>，理解如何扩展或修改 iTop。&lt;/li>
&lt;li>参考&lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:add-attribute-sample">逐步示例&lt;/a>，创建您的第一个扩展。&lt;/li>
&lt;li>使用&lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:new_extension">扩展骨架生成工具&lt;/a>创建新扩展，并了解&lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:new_extension">文件结构&lt;/a>。&lt;/li>
&lt;li>使用&lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:api:objects-manipulation:start">对象操作 API&lt;/a> 搜索和操作对象。&lt;/li>
&lt;li>使用 &lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:extensibility:events_crud">CRUD 事件&lt;/a> 在对象上添加业务逻辑，事件遵循 &lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:sequence_crud">CRUD 序列&lt;/a>。&lt;/li>
&lt;li>使用 &lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:events_api">Events API&lt;/a> 添加自定义事件（iTop 3.1 新增）。&lt;/li>
&lt;li>使用 &lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:extensions_api:interfaces">Interfaces API&lt;/a> 定制 GUI。&lt;/li>
&lt;li>&lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:xml_reference">XML 数据模型参考&lt;/a> 和 &lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:portal_xml">XML Portal 参考&lt;/a>。&lt;/li>
&lt;li>&lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:coding_standards">iTop 编码标准&lt;/a>。&lt;/li>
&lt;li>图标使用 &lt;a href="https://fontawesome.com/v5/search">FontAwesome v5&lt;/a>。&lt;/li>
&lt;/ul>
&lt;h2 id="how-to-示例">&amp;ldquo;How to&amp;rdquo; 示例&lt;/h2>
&lt;h3 id="修改数据模型">修改数据模型&lt;/h3>
&lt;h4 id="类字段与关系">类、字段与关系&lt;/h4>
&lt;ul>
&lt;li>属性用法与约束&lt;/li>
&lt;li>为 Server 类添加字段&lt;/li>
&lt;li>（重新）定义字典条目&lt;/li>
&lt;li>强制字段始终必填&lt;/li>
&lt;li>从 Ticket 中移除字段&lt;/li>
&lt;li>为 Team 添加仪表板&lt;/li>
&lt;li>创建新的 CI 类：Monitor&lt;/li>
&lt;li>定义依赖关系&lt;/li>
&lt;li>添加 1:1 关系&lt;/li>
&lt;li>n-n 自反与对称关系&lt;/li>
&lt;li>对象创建者&lt;/li>
&lt;li>合并状态&lt;/li>
&lt;li>在 PHP 中添加 TagSet&lt;/li>
&lt;li>在 PHP 中添加日志条目&lt;/li>
&lt;li>添加 n:n 关系&lt;/li>
&lt;li>机密属性&lt;/li>
&lt;/ul>
&lt;h4 id="生命周期状态转换计时器">生命周期：状态、转换、计时器&lt;/h4>
&lt;ul>
&lt;li>添加状态和转换&lt;/li>
&lt;li>统计在状态中花费的时间&lt;/li>
&lt;li>在状态延迟后通知&lt;/li>
&lt;li>计时器行为&lt;/li>
&lt;li>为物理设备添加生命周期&lt;/li>
&lt;li>通过生命周期强制字段必填&lt;/li>
&lt;li>在转换上执行操作&lt;/li>
&lt;li>转换上可用的预定义方法&lt;/li>
&lt;li>允许在非默认状态直接创建&lt;/li>
&lt;li>在日志更新时重新分配工单&lt;/li>
&lt;li>隐藏转换&lt;/li>
&lt;/ul>
&lt;h4 id="认证与权限">认证与权限&lt;/h4>
&lt;ul>
&lt;li>创建新角色&lt;/li>
&lt;li>委派&amp;quot;管理工具&amp;quot;菜单&lt;/li>
&lt;li>定义密码策略&lt;/li>
&lt;li>实现密码过期&lt;/li>
&lt;li>创建自定义认证方式&lt;/li>
&lt;li>防止用户意外被禁用&lt;/li>
&lt;/ul>
&lt;h3 id="用户界面">用户界面&lt;/h3>
&lt;h4 id="必填隐藏控制">必填、隐藏、控制&lt;/h4>
&lt;ul>
&lt;li>强制字段必填&lt;/li>
&lt;li>将字段设为只读&lt;/li>
&lt;li>为某些用户隐藏成本&lt;/li>
&lt;li>表单预填充：创建表单预填充、转换预填充、搜索条件预填充&lt;/li>
&lt;li>数据完整性检查：确保结束日期在起始日期之后、物理设备在生产环境时必须填写位置、防止 LinkedSet 变更超出库存、防止人员组织变更破坏门户用户关联、限制用户只能修改不能创建对象&lt;/li>
&lt;li>定义过时规则&lt;/li>
&lt;li>防止重复&lt;/li>
&lt;/ul>
&lt;h4 id="显示">显示&lt;/h4>
&lt;ul>
&lt;li>更改 iTop 主页&lt;/li>
&lt;li>在&amp;quot;其他操作&amp;quot;弹出菜单中添加条目&lt;/li>
&lt;li>为控制台仪表板创建新 dashlet：iFrame&lt;/li>
&lt;li>丰富对象显示&lt;/li>
&lt;li>区分同名对象&lt;/li>
&lt;li>更改页面标题&lt;/li>
&lt;li>对象间导航&lt;/li>
&lt;li>隐藏对象标签页：影响分析或仪表板&lt;/li>
&lt;li>在列表上添加操作&lt;/li>
&lt;li>隐藏对象历史记录&lt;/li>
&lt;li>添加对象概览&lt;/li>
&lt;li>枚举值排序&lt;/li>
&lt;li>转换排序&lt;/li>
&lt;li>计算对象图标&lt;/li>
&lt;/ul>
&lt;h4 id="主题与颜色">主题与颜色&lt;/h4>
&lt;ul>
&lt;li>更改 iTop 徽标&lt;/li>
&lt;li>更改颜色等&lt;/li>
&lt;li>高亮关键对象&lt;/li>
&lt;li>高亮状态&lt;/li>
&lt;li>更改菜单图标&lt;/li>
&lt;li>类颜色与图标&lt;/li>
&lt;li>更改左侧菜单颜色&lt;/li>
&lt;li>更改主色调&lt;/li>
&lt;li>创建新主题&lt;/li>
&lt;/ul>
&lt;h3 id="自动化">自动化&lt;/h3>
&lt;ul>
&lt;li>使用对象复制器复制 linkedset&lt;/li>
&lt;li>计算工单结束日期&lt;/li>
&lt;li>统计工单重新打开次数&lt;/li>
&lt;li>在 1:n 上计算字段&lt;/li>
&lt;li>在 n:n 上计算字段&lt;/li>
&lt;li>存储 n:n 关系计数&lt;/li>
&lt;li>从外部应用同步数据&lt;/li>
&lt;li>将工单转移到另一个 iTop&lt;/li>
&lt;li>存储 1:n 关系计数&lt;/li>
&lt;li>在添加附件时添加日志条目&lt;/li>
&lt;li>计算 linkedset 依赖值&lt;/li>
&lt;/ul>
&lt;h3 id="工单管理">工单管理&lt;/h3>
&lt;ul>
&lt;li>统计等待第三方的时间&lt;/li>
&lt;li>考虑覆盖窗口计算解决延迟&lt;/li>
&lt;li>统计用户请求重新打开次数&lt;/li>
&lt;li>在延迟后自动关闭&lt;/li>
&lt;li>计划日期开始的用户请求 TTO&lt;/li>
&lt;li>计划用户请求（高级）&lt;/li>
&lt;li>按服务子类别设置 SLA&lt;/li>
&lt;li>从父组织继承服务&lt;/li>
&lt;li>按国家使用节假日日历计算 SLA&lt;/li>
&lt;li>级联变更关闭：在相关变更关闭时自动解决所有关联用户请求&lt;/li>
&lt;li>使用中间商的服务提供商&lt;/li>
&lt;li>在日志更新时重新分配工单&lt;/li>
&lt;/ul>
&lt;h2 id="定制门户">定制门户&lt;/h2>
&lt;p>自 2.3 版本起，增强型门户提供了定制选项。&lt;/p>
&lt;ul>
&lt;li>门户定制概览&lt;/li>
&lt;li>门户 XML 参考&lt;/li>
&lt;li>门户限制&lt;/li>
&lt;/ul>
&lt;h3 id="操作示例">操作示例&lt;/h3>
&lt;ul>
&lt;li>在用户门户上强制字段必填&lt;/li>
&lt;li>允许查看更多或更少的工单&lt;/li>
&lt;li>为他人创建工单&lt;/li>
&lt;li>更改范围&lt;/li>
&lt;li>更改 Bootstrap 主题&lt;/li>
&lt;li>更改菜单图标&lt;/li>
&lt;li>添加&amp;quot;创建&amp;quot;按钮&lt;/li>
&lt;li>添加新的浏览模式&lt;/li>
&lt;li>添加 Dashlet&lt;/li>
&lt;li>创建新门户&lt;/li>
&lt;li>门户上的可选关系&lt;/li>
&lt;li>为各种客户创建工单&lt;/li>
&lt;li>在表单中定位附件&lt;/li>
&lt;/ul>
&lt;h2 id="贡献-itop-翻译">贡献 iTop 翻译&lt;/h2>
&lt;ul>
&lt;li>如何翻译&lt;/li>
&lt;/ul>
&lt;hr>
&lt;p>原文：&lt;a href="https://www.itophub.io/wiki/page?id=3_2_0:customization:start">https://www.itophub.io/wiki/page?id=3_2_0:customization:start&lt;/a>&lt;/p>
&lt;p>Last modified: 2026/06/10 17:31 by127.0.0.1&lt;/p>
&lt;p>版本：3_2_0/customization/start.txt · Last modified: 2026/06/10 17:31 by 127.0.0.1&lt;/p></description></item></channel></rss>