File: translate.html

package info (click to toggle)
cockpit 355-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 311,568 kB
  • sloc: javascript: 774,787; python: 40,655; ansic: 35,157; cpp: 11,141; sh: 3,512; makefile: 580; xml: 261
file content (128 lines) | stat: -rw-r--r-- 4,669 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Cockpit playground</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="../base1/cockpit.js"></script>
</head>
<body class="pf-v6-m-tabular-nums" hidden="true">
   <div class="pf-v6-c-page">
        <main class="pf-v6-c-page__main" tabindex="-1">
            <section id="internal" class="pf-v6-c-page__main-section pf-m-light">
                <h2>HTML translations</h2>

                <p>For translating HTML use these forms:</p>

                <p>
                    <code>&lt;span translate&gt;Ready&lt;/span&gt;</code>
                    = <span translate="yes" id="translate-html">Ready</span>
                </p>

                <p>
                    <code>&lt;span translate translate-context="verb"&gt;Ready&lt;/span&gt;</code>
                    = <span translate="yes" translate-context="verb" id="translate-html-context">Ready</span>
                </p>

                <p>
                    <code>&lt;span translate="yes"&gt;Not ready&lt;/span&gt;</code>
                    = <span translate="yes" id="translate-html-yes">Not ready</span>
                </p>

                <p>Note that we do <b>not support</b>:</p>
                <ul>
                    <li>Interpolation of variables.</li>
                    <li>Pluralization</li>
                    <li>The <code>&lt;translate&gt;</code> element</li>
                </ul>

                <hr />

                <h2>Old Glade style</h2>

                <p>The old Glade style is not recommended:</p>

                <p>
                    <code>&lt;span translate="yes"&gt;Empty&lt;/span&gt;</code>
                    = <span translate="yes" id="translatable-glade">Empty</span>
                </p>

                <p>
                    <code>&lt;span translate="yes" context="verb"&gt;Empty&lt;/span&gt;</code>
                    = <span translate="yes" context="verb" id="translatable-glade-context">Empty</span>
                </p>

                <p>Note that we do <b>not support</b>:</p>
                <ul>
                    <li>Interpolation of variables.</li>
                    <li>Translatable attributes.</li>
                    <li>Pluralization</li>
                    <li>The <code>&lt;translate&gt;</code> element</li>
                </ul>

                <hr />

                <h2>Code Translations</h2>

                <p>For translating in javascript code, use these forms:</p>

                <p>
                    <code>_("Empty")</code>
                    = <span id="underscore-empty"></span>
                </p>

                <p>
                    <code>_("verb", "Empty")</code>
                    = <span id="underscore-context-empty"></span>
                </p>

                <p>
                    <code>C_("verb", "Empty")</code>
                    = <span id="cunderscore-context-empty"></span>
                </p>

                <p>
                    <code>cockpit.gettext("Control")</code>
                    = <span id="gettext-control"></span>
                </p>

                <p>
                    <code>cockpit.gettext("key", "Control")</code>
                    = <span id="gettext-context-control"></span>
                </p>

                <p>
                    <code>cockpit.ngettext("$0 disk is missing", "$0 disks are missing", 1)</code>
                    = <span id="ngettext-disks-1"></span>
                </p>

                <p>
                    <code>cockpit.ngettext("$0 disk is missing", "$0 disks are missing", 2)</code>
                    = <span id="ngettext-disks-2"></span>
                </p>

                <p>
                    <code>cockpit.ngettext("disk-non-rotational", "$0 disk is missing", "$0 disks are missing", 1)</code>
                    = <span id="ngettext-context-disks-1"></span>
                </p>

                <p>
                    <code>cockpit.ngettext("disk-non-rotational", "$0 disk is missing", "$0 disks are missing", 2)</code>
                    = <span id="ngettext-context-disks-2"></span>
                </p>

                <p>Note that we do <b>not support</b>:</p>
                <ul>
                    <li>Extraction of single quoted strings.</li>
                </ul>
            </section>
        </main>
    </div>
    <script src="translate.js"></script>
    <!-- Bring in initial translations -->
    <script src="../base1/po.js"></script>
    <script src="po.js"></script>
    <!-- Override translations from here -->
    <script src="po.extra.js"></script>
</body>
</html>