支持多种语言

如需支持多种语言,请创建一个包含多个 <info> 代码块(每种语言一个 <info> 代码块)的 <alert> 对象,如以下代码示例所示。针对语言代码使用有效的 RFC 3066。

如果不存在语言 <info> 块,则 <language> 值默认为 en-US

示例

<?xml version="1.0" encoding="UTF-8"?>
<alert xmlns="urn:oasis:names:tc:emergency:cap:1.2">
  <identifier>urn:oid:2.49.0.1.124.3669530287.2023</identifier>
  <sender>cap-pac@canada.ca</sender>
  <sent>2023-05-29T04:25:06-00:00</sent>
  <status>Actual</status>
  <msgType>Update</msgType>
  <source>Env. Can. - Can. Met. Ctr. - Montréal</source>
  <scope>Public</scope>
  <info>
      <language>en-CA</language>
      <category>Met</category>
      <event>freezing rain</event>
      <responseType>Monitor</responseType>
      <urgency>Future</urgency>
      <severity>Moderate</severity>
      <certainty>Likely</certainty>
      <audience>general public</audience>
      <eventCode>
        <valueName>profile:CAP-CP:Event:0.4</valueName>
        <value>freezeRain</value>
      </eventCode>
      <eventCode>
        <valueName>SAME</valueName>
        <value>WSW</value>
      </eventCode>
      <effective>2023-05-29T04:23:50-00:00</effective>
      <expires>2023-05-29T16:59:50-00:00</expires>
      <senderName>Environment Canada</senderName>
      <headline>freezing rain warning in effect</headline>
      <description>
Freezing rain is expected or occurring.

A low pressure system tracking across the central Arctic will spread
 freezing rain into Kinngait overnight tonight.

The freezing rain will transition to rain late Monday morning as
 temperatures rise above zero.
</description>
      <instruction>
Take extra care when walking or driving in affected areas. Be prepared to
 adjust your driving with changing road conditions.
</instruction>
      ...
  </info>
  <info>
      <language>fr-CA</language>
      <category>Met</category>
      <event>pluie verglaçante</event>
      <responseType>Monitor</responseType>
      <urgency>Future</urgency>
      <severity>Moderate</severity>
      <certainty>Likely</certainty>
      <audience>grand public</audience>
      <eventCode>
        <valueName>profile:CAP-CP:Event:0.4</valueName>
        <value>freezeRain</value>
      </eventCode>
      <eventCode>
        <valueName>SAME</valueName>
        <value>WSW</value>
      </eventCode>
      <effective>2023-05-29T04:23:50-00:00</effective>
      <expires>2023-05-29T16:59:50-00:00</expires>
      <senderName>Environnement Canada</senderName>
      <headline>avertissement de pluie verglaçante en vigueur</headline>
      <description>
Il y a ou il y aura de la pluie verglaçante.

Une dépression traversant le centre de l'Arctique propagera de la pluie
 verglaçante sur Kinngait au cours de la nuit cette nuit.

La pluie verglaçante se changera en pluie tard lundi matin à mesure que les
 températures augmenteront au-dessus de zéro.
</description>
      <instruction>
Faites preuve de prudence lorsque vous marchez ou conduisez dans les
 secteurs touchés. Adaptez votre conduite aux conditions routières
 changeantes.
</instruction>
      ...
  </info>
</alert>