<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" />

  <xsl:template match="/">
    <html>
      <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
      </head>
      <body>
        <h2>message list</h2>
        <table border="1">
          <tr bgcolor="#9acd32">
            <th>target module/function</th>
            <th>message</th>
            <th>note</th>
            <th>
              繁體中文
            </th>
            <th>
              简体中文
            </th>
            <th>
              English
            </th>
            <th>
              日本語
            </th>
            <th>
              한국어
            </th>
            <th>
              Русский
            </th>
          </tr>
          <xsl:for-each select="locale/record">
            <xsl:sort select="./target" />
            <tr>
              <td>
                <xsl:value-of select="./target" />
              </td>
              <td>
                <xsl:value-of select="./message" />
              </td>
              <td>
                <xsl:value-of select="./note" />
              </td>
              <td>
                <xsl:value-of select="./translate[lang='cmn-Hant-TW']" />
              </td>
              <td>
                <xsl:value-of select="./translate[lang='cmn-Hans-CN']" />
              </td>
              <td>
                <xsl:value-of select="./translate[lang='en-US']" />
              </td>
              <td>
                <xsl:value-of select="./translate[lang='ja-JP']" />
              </td>
              <td>
                <xsl:value-of select="./translate[lang='ko-KR']" />
              </td>
              <td>
                <xsl:value-of select="./translate[lang='ru-RU']" />
              </td>
            </tr>
          </xsl:for-each>
        </table>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>