summaryrefslogtreecommitdiffstats
path: root/src/opk.c
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-04-20 13:35:39 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-04-20 13:35:39 (EDT)
commitcdde4ea4dcd08b8cbe0da7f6360f0412debf51d5 (patch)
tree2dac423e7fcf168dd41eca6a8d7a4f5b92280f42 /src/opk.c
parentc171aaa9dea40ce48a8144d82edeb387eda4df92 (diff)
main, opk: Translate strings
Diffstat (limited to 'src/opk.c')
-rw-r--r--src/opk.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/opk.c b/src/opk.c
index 578f85b..ddcacea 100644
--- a/src/opk.c
+++ b/src/opk.c
@@ -24,6 +24,7 @@
#include <time.h>
#include "defs.h"
#include "gzip.h"
+#include "i18n.h"
#include "opk.h"
#include "ustar.h"
@@ -69,7 +70,7 @@ opkg_opk_opk_init(const char *file_name)
/* Open outer archive. */
opk->file = fopen(file_name, "rb");
if (opk->file == NULL) {
- fprintf(stderr, "Error: Failed to open file \"%s\"\n",
+ fprintf(stderr, _("Error: Failed to open file \"%s\"\n"),
file_name);
goto error1;
}
@@ -77,34 +78,34 @@ opkg_opk_opk_init(const char *file_name)
/* Initialize outer gzip decompressor. */
opk->outer_gzip = opkg_opk_gzip_init(&_opkg_opk_opk_file_read, opk);
if (opk->outer_gzip == NULL) {
- fputs("Error: Failed to initialize\n", stderr);
+ fputs(_("Error: Failed to initialize\n"), stderr);
goto error2;
}
/* Initialize outer ustar unarchiver. */
opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip);
if (opk->outer_ustar == NULL) {
- fputs("Error: Failed to initialize\n", stderr);
+ fputs(_("Error: Failed to initialize\n"), stderr);
goto error3;
}
/* Check package version. */
if (opkg_opk_ustar_seek_one(opk->outer_ustar, "debian-binary") !=
OPKG_OPK_OK) {
- fputs("Error: Failed to find \"debian-binary\" in archive\n",
+ fputs(_("Error: Failed to find \"debian-binary\" in archive\n"),
stderr);
goto error4;
}
if (opkg_opk_ustar_read(opk->outer_ustar,
&opk->version_buffer, &opk->version_size) !=
OPKG_OPK_OK) {
- fputs("Error: Failed to read \"debian-binary\" in archive\n",
+ fputs(_("Error: Failed to read \"debian-binary\" in archive\n"),
stderr);
goto error4;
}
if (opk->version_size < 4 || strncmp(opk->version_buffer, "2.", 2) != 0)
{
- fputs("Error: Unsupported package version\n", stderr);
+ fputs(_("Error: Unsupported package version\n"), stderr);
goto error4;
}
@@ -133,13 +134,13 @@ _opkg_opk_opk_init_inner(struct opkg_opk_opk *opk, const char *member)
while ((ret = opkg_opk_ustar_read(opk->outer_ustar, NULL, NULL)) ==
OPKG_OPK_OK);
if (ret == OPKG_OPK_ERROR) {
- fputs("Error: Failed to read archive\n", stderr);
+ fputs(_("Error: Failed to read archive\n"), stderr);
return OPKG_OPK_ERROR;
}
/* Find requested inner archive. */
if (opkg_opk_ustar_seek_one(opk->outer_ustar, member) != OPKG_OPK_OK) {
- fprintf(stderr, "Error: Failed to find \"%s\" in archive\n",
+ fprintf(stderr, _("Error: Failed to find \"%s\" in archive\n"),
member);
return OPKG_OPK_ERROR;
}
@@ -149,14 +150,14 @@ _opkg_opk_opk_init_inner(struct opkg_opk_opk *opk, const char *member)
(opkg_opk_gzip_read_func *) &opkg_opk_ustar_read,
opk->outer_ustar);
if (opk->inner_gzip == NULL) {
- fputs("Error: Failed to initialize\n", stderr);
+ fputs(_("Error: Failed to initialize\n"), stderr);
return OPKG_OPK_ERROR;
}
/* Initialize inner ustar unarchiver. */
opk->inner_ustar = opkg_opk_ustar_init(opk->inner_gzip);
if (opk->inner_ustar == NULL) {
- fputs("Error: Failed to initialize\n", stderr);
+ fputs(_("Error: Failed to initialize\n"), stderr);
opkg_opk_gzip_free(opk->inner_gzip);
return OPKG_OPK_ERROR;
}
@@ -193,14 +194,15 @@ opkg_opk_opk_read_control(struct opkg_opk_opk *opk,
&buffer, &size)) == OPKG_OPK_OK)
{
if (fwrite(buffer, 1, size, stdout) != size) {
- fputs("Error: Failed to print control file\n",
- stderr);
+ fputs(_("Error: Failed to print control file\n")
+ , stderr);
_opkg_opk_opk_free_inner(opk);
return OPKG_OPK_ERROR;
}
}
if (ret_read == OPKG_OPK_ERROR) {
- fputs("Error: Failed to read control file\n", stderr);
+ fputs(_("Error: Failed to read control file\n"),
+ stderr);
_opkg_opk_opk_free_inner(opk);
return OPKG_OPK_ERROR;
}
@@ -210,7 +212,7 @@ opkg_opk_opk_read_control(struct opkg_opk_opk *opk,
}
}
if (ret_seek == OPKG_OPK_ERROR) {
- fputs("Error: Failed to find control file\n", stderr);
+ fputs(_("Error: Failed to find control file\n"), stderr);
_opkg_opk_opk_free_inner(opk);
return OPKG_OPK_ERROR;
}
@@ -273,7 +275,7 @@ opkg_opk_opk_list_members(struct opkg_opk_opk *opk)
}
}
if (ret == OPKG_OPK_ERROR) {
- fputs("Error: Failed to list data files\n", stderr);
+ fputs(_("Error: Failed to list data files\n"), stderr);
_opkg_opk_opk_free_inner(opk);
return OPKG_OPK_ERROR;
}