Browse Source

Add _ macro for future i18n

r1434
master
Denis Barbier 20 years ago
parent
commit
60a234f02f
  1. 2
      debian/changelog
  2. 8
      netcfg-dhcp.c
  3. 14
      netcfg-static.c
  4. 22
      netcfg.c
  5. 4
      netcfg.h

2
debian/changelog

@ -3,6 +3,8 @@ netcfg (0.21) UNRELEASED; urgency=low
* Martin Sjögren
- Added sv.po (thanks to David Weinehall)
- Use libdebian-installer3
* Denis Barbier
- Add _ macro for future i18n
-- Martin Sjogren <md9ms@mdstud.chalmers.se> Thu, 28 Nov 2002 22:20:36 +0100

8
netcfg-dhcp.c

@ -75,7 +75,7 @@ static void netcfg_get_dhcp()
client->command(client, "subst", "netcfg/confirm_dhcp",
"dhcp_hostname",
(dhcp_hostname ? dhcp_hostname : "<none>"), NULL);
(dhcp_hostname ? dhcp_hostname : _("<none>")), NULL);
}
@ -133,7 +133,7 @@ int main(int argc, char *argv[])
int finished = 0;
struct stat buf;
client = debconfclient_new();
client->command(client, "title", "DHCP Network Configuration",
client->command(client, "title", _("DHCP Network Configuration"),
NULL);
@ -161,14 +161,14 @@ int main(int argc, char *argv[])
"hostname", hostname, NULL);
client->command(client, "subst", "netcfg/confirm_dhcp",
"domain", (domain ? domain : "<none>"),
"domain", (domain ? domain : _("<none>")),
NULL);
netcfg_nameservers_to_array(nameservers, nameserver_array);
client->command(client, "subst", "netcfg/confirm_dhcp",
"nameservers",
(nameservers ? nameservers : "<none>"),
(nameservers ? nameservers : _("<none>")),
NULL);
netcfg_get_dhcp();

14
netcfg-static.c

@ -67,7 +67,7 @@ static void netcfg_get_static()
client->command(client, "subst", "netcfg/confirm_static",
"ipaddress",
(ipaddress ? num2dot(ipaddress) : "<none>"), NULL);
(ipaddress ? num2dot(ipaddress) : _("<none>")), NULL);
if (strncmp(interface, "plip", 4) == 0
|| strncmp(interface, "slip", 4) == 0
@ -102,16 +102,16 @@ static void netcfg_get_static()
}
client->command(client, "subst", "netcfg/confirm_static",
"netmask", (netmask ? num2dot(netmask) : "<none>"),
"netmask", (netmask ? num2dot(netmask) : _("<none>")),
NULL);
client->command(client, "subst", "netcfg/confirm_static",
"gateway", (gateway ? num2dot(gateway) : "<none>"),
"gateway", (gateway ? num2dot(gateway) : _("<none>")),
NULL);
client->command(client, "subst", "netcfg/confirm_static",
"pointopoint",
(pointopoint ? num2dot(pointopoint) : "<none>"),
(pointopoint ? num2dot(pointopoint) : _("<none>")),
NULL);
broadcast = (network | ~netmask);
@ -211,7 +211,7 @@ int main(int argc, char *argv[])
char *ptr;
char *nameservers = NULL;
client = debconfclient_new();
client->command(client, "title", "Static Network Configuration",
client->command(client, "title", _("Static Network Configuration"),
NULL);
@ -226,12 +226,12 @@ int main(int argc, char *argv[])
"hostname", hostname, NULL);
client->command(client, "subst", "netcfg/confirm_static",
"domain", (domain ? domain : "<none>"),
"domain", (domain ? domain : _("<none>")),
NULL);
client->command(client, "subst", "netcfg/confirm_static",
"nameservers",
(nameservers ? nameservers : "<none>"),
(nameservers ? nameservers : _("<none>")),
NULL);
netcfg_nameservers_to_array(nameservers, nameserver_array);

22
netcfg.c

@ -150,25 +150,25 @@ char *get_ifdsc(const char *ifp)
char *description;
} interface_alist[] = {
{
"eth", "Ethernet or Fast Ethernet"}
"eth", _("Ethernet or Fast Ethernet")}
, {
"pcmcia", "PC-Card (PCMCIA) Ethernet or Token Ring"}
"pcmcia", _("PC-Card (PCMCIA) Ethernet or Token Ring")}
, {
"tr", "Token Ring"}
"tr", _("Token Ring")}
, {
"arc", "Arcnet"}
"arc", _("Arcnet")}
, {
"slip", "Serial-line IP"}
"slip", _("Serial-line IP")}
, {
"plip", "Parallel-line IP"}
"plip", _("Parallel-line IP")}
, {
"ctc", "Channel-to-channel"}
"ctc", _("Channel-to-channel")}
, {
"escon", "Real channel-to-channel"}
"escon", _("Real channel-to-channel")}
, {
"hsi", "Hypersocket"}
"hsi", _("Hypersocket")}
, {
"iucv", "Inter-user communication vehicle"}
"iucv", _("Inter-user communication vehicle")}
, {
NULL, NULL}
};
@ -177,7 +177,7 @@ char *get_ifdsc(const char *ifp)
if (!strncmp(ifp, interface_alist[i].interface,
strlen(interface_alist[i].interface)))
return interface_alist[i].description;
return "unknown interface";
return _("unknown interface");
}

4
netcfg.h

@ -14,6 +14,10 @@
#define DHCPCD_FILE "/etc/dhcpc/config"
#define DHCLIENT_DIR "/var/dhcp"
#ifndef _
#define _(x) (x)
#endif
extern int netcfg_mkdir (char *path);

Loading…
Cancel
Save