File: sections_trans.cc

package info (click to toggle)
synaptic 0.91.7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,676 kB
  • sloc: cpp: 19,830; xml: 10,562; ansic: 2,084; makefile: 498; sed: 93; python: 82; sh: 52
file content (181 lines) | stat: -rw-r--r-- 7,808 bytes parent folder | download | duplicates (4)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/* sections_trans.cc - translate debian sections into friendlier names
 *  (c) 2004 Michael Vogt
 *
 */

#include <libintl.h>

#include "sections_trans.h"

const char *transtable[][2] = {
   // TRANSLATORS: Alias for the Debian package section "admin"
   {"admin", _("System Administration")},
   // TRANSLATORS: Alias for the Debian package section "base"
   {"base", _("Base System")},
   // TRANSLATORS: Alias for the Debian package section "cli-mono"
   {"cli-mono", _("Mono/CLI Infrastructure")},
   // TRANSLATORS: Alias for the Debian package section "comm"
   {"comm", _("Communication")},
   // TRANSLATORS: Alias for the Debian package section "database"
   {"database", _("Databases")},
   // TRANSLATORS: Alias for the Debian package section "devel"
   {"devel", _("Development")},
   // TRANSLATORS: Alias for the Debian package section "doc"
   {"doc", _("Documentation")},
   // TRANSLATORS: Alias for the Debian package section "debug"
   {"debug", _("Debug")},
   // TRANSLATORS: Alias for the Debian package section "editors"
   {"editors", _("Editors")},
   // TRANSLATORS: Alias for the Debian package section "electronics"
   {"electronics", _("Electronics")},
   // TRANSLATORS: Alias for the Debian package section "embedded"
   {"embedded", _("Embedded Devices")},
   // TRANSLATORS: Alias for the Debian package section "fonts"
   {"fonts", _("Fonts")},
   // TRANSLATORS: Alias for the Debian package section "games"
   {"games", _("Games and Amusement")},
   // TRANSLATORS: Alias for the Debian package section "gnome"
   {"gnome", _("GNOME Desktop Environment")},
   // TRANSLATORS: Alias for the Debian package section "graphics"
   {"graphics", _("Graphics")},
   // TRANSLATORS: Alias for the Debian package section "gnu-r"
   {"gnu-r", _("GNU R statistical system")},
   // TRANSLATORS: Alias for the Debian package section "gnustep"
   {"gnustep", _("Gnustep Desktop Environment")},
   // TRANSLATORS: Alias for the Debian package section "golang"
   {"golang", _("Go Programming Language")},
   // TRANSLATORS: Alias for the Debian package section "hamradio"
   {"hamradio", _("Amateur Radio")},
   // TRANSLATORS: Alias for the Debian package section "haskell"
   {"haskell", _("Haskell Programming Language")},
   // TRANSLATORS: Alias for the Debian package section "httpd"
   {"httpd", _("Web servers")},
   // TRANSLATORS: Alias for the Debian package section "interpreters"
   {"interpreters", _("Interpreted Computer Languages")},
   // TRANSLATORS: Alias for the Debian package section "java"
   {"java", _("Java Programming Language")},
   // TRANSLATORS: Alias for the Debian package section "javascript"
   {"javascript", _("JavaScript Programming Language")},
   // TRANSLATORS: Alias for the Debian package section "KDE"
   {"kde", _("KDE Desktop Environment")},
   // TRANSLATORS: Alias for the Debian package section "kernel"
   {"kernel", _("Kernel and modules")},
   // TRANSLATORS: Alias for the Debian package section "libdevel"
   {"libdevel", _("Libraries - Development")},
   // TRANSLATORS: Alias for the Debian package section "libs"
   {"libs", _("Libraries")},
   // TRANSLATORS: Alias for the Debian package section "lisp"
   {"lisp", _("Lisp Programming Language")},
   // TRANSLATORS: Alias for the Debian package section "localization"
   {"localization", _("Localization")},
   // TRANSLATORS: Alias for the Debian package section "mail"
   {"mail", _("Email")},
   // TRANSLATORS: Alias for the Debian package section "math"
   {"math", _("Mathematics")},
   // TRANSLATORS: Alias for the Debian package section "misc"
   {"misc", _("Miscellaneous - Text Based")},
   // TRANSLATORS: Alias for the Debian package section "net"
   {"net", _("Networking")},
   // TRANSLATORS: Alias for the Debian package section "news"
   {"news", _("Newsgroup")},
   // TRANSLATORS: Alias for the Debian package section "ocaml"
   {"ocaml", _("OCaml Programming Language")},
   // TRANSLATORS: Alias for the Debian package section "oldlibs"
   {"oldlibs", _("Libraries - Old")},
   // TRANSLATORS: Alias for the Debian package section "otherosfs"
   {"otherosfs", _("Cross Platform")},
   // TRANSLATORS: Alias for the Debian package section "perl"
   {"perl", _("Perl Programming Language")},
   // TRANSLATORS: Alias for the Debian package section "php"
   {"php", _("PHP Programming Language")},
   // TRANSLATORS: Alias for the Debian package section "python"
   {"python", _("Python Programming Language")},
   // TRANSLATORS: Alias for the Debian package section "ruby"
   {"ruby", _("Ruby Programming Language")},
   // TRANSLATORS: Alias for the Debian package section "rust"
   {"rust", _("Rust Programming Language")},
   // TRANSLATORS: Alias for the Debian package section "science"
   {"science", _("Science")},
   // TRANSLATORS: Alias for the Debian package section "shells"
   {"shells", _("Shells")},
   // TRANSLATORS: Alias for the Debian package section "sound"
   {"sound", _("Multimedia")},
   // TRANSLATORS: Alias for the Debian package section "task"
   {"tasks", _("Tasks")},
   // TRANSLATORS: Alias for the Debian package section "tex"
   {"tex", _("TeX Authoring")},
   // TRANSLATORS: Alias for the Debian package section "text"
   {"text", _("Word Processing")},
   // TRANSLATORS: Alias for the Debian package section "utils"
   {"utils", _("Utilities")},
   // TRANSLATORS: Alias for the Debian package section "vcs"
   {"vcs", _("Version Control Systems")},
   // TRANSLATORS: Alias for the Debian package section "video"
   {"video", _("Video software")},
   // TRANSLATORS: Alias for the Debian package section "web"
   {"web", _("World Wide Web")},
   // TRANSLATORS: Alias for the Debian package section "x11"
   {"x11", _("Miscellaneous - Graphical")},
   // TRANSLATORS: Alias for the Debian package section "xfce"
   {"xfce", _("Xfce Desktop Environment")},
   // TRANSLATORS: Alias for the Debian package section "zope"
   {"zope", _("Zope/Plone Environment")},
   // TRANSLATORS: The section of the package is not known
   {"unknown", _("Unknown")},
   // TRANSLATORS: Alias for the Debian package section "alien"
   {"alien", _("Converted From RPM by Alien")},
   // TRANSLATORS: Ubuntu translations section
   {"translations", _("Internationalization and localization")},
   // TRANSLATORS: metapackages section
   {"metapackages", _("Meta Packages")},
   // TRANSLATORS: Alias for the Debian package section "education"
   {"education", _("Education")},
   // TRANSLATORS: Alias for the Debian package section "introspection"
   {"introspection", _("GObject Introspection data")},

   // TRANSLATORS: Alias for the Debian package section "non free"
   {"non-free", _("non free")},
   // TRANSLATORS: Alias for the Debian package section "contrib"
   //              Free software that depends on non-free software
   {"contrib", _("contrib")},
   {NULL, NULL}
};

#ifndef HAVE_RPM
string trans_section(string sec)
{
   string str = sec;
   string suffix;
   // if we have something like "contrib/web", make "contrib" the
   // suffix and translate it independently
   string::size_type n = str.find("/");
   if (n != string::npos) {
      suffix = str.substr(0, n);
      str.erase(0, n + 1);
      for (int i = 0; transtable[i][0] != NULL; i++) {
         if (suffix == transtable[i][0]) {
            suffix = _(transtable[i][1]);
            break;
         }
      }
   }
   for (int i = 0; transtable[i][0] != NULL; i++) {
      if (str == transtable[i][0]) {
         str = _(transtable[i][1]);
         break;
      }
   }
   // if we have a suffix, add it
   if (!suffix.empty()) {
      ostringstream out;
      ioprintf(out, "%s (%s)", str.c_str(), suffix.c_str());
      str = out.str();
   }
   return str;
}
#else
string trans_section(string sec)
{
   return dgettext("rpm", sec.c_str());
}
#endif