summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKonstantin <ria_freelander@gmail.com>2016-06-13 21:37:24 +0300
committerKonstantin <ria_freelander@gmail.com>2016-06-13 21:37:24 +0300
commitc786c7c44a12c04b248376f04679f2f80c0d0d02 (patch)
treeccd0783d62f36dbbab12922874bbd9c71d37f64e /locale.c
parent902e80b2d4cbe64ce4703c8ac0f5f7403774f064 (diff)
downloadmusl-locales-c786c7c44a12c04b248376f04679f2f80c0d0d02.tar.gz
musl-locales-c786c7c44a12c04b248376f04679f2f80c0d0d02.tar.bz2
musl-locales-c786c7c44a12c04b248376f04679f2f80c0d0d02.tar.xz
musl-locales-c786c7c44a12c04b248376f04679f2f80c0d0d02.zip
Raspberry fixes
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/locale.c b/locale.c
index cfe2f20..ede426d 100644
--- a/locale.c
+++ b/locale.c
@@ -49,13 +49,13 @@ static void usage(char *name)
s = basename(name);
fprintf(stderr,
- "Usage: %s [-a | -m] [FORMAT] name...\n\n"
+ gettext ("Usage: %s [-a | -m] [FORMAT] name...\n\n"
"\t-a, --all-locales\tWrite names of all available locales\n"
"\t-m, --charmaps\tWrite names of available charmaps\n"
"\nFORMAT:\n"
"\t-c, --category-name\tWrite names of selected categories\n"
"\t-k, --keyword-name\tWrite names of selected keywords\n"
- , s);
+ ), s);
}
static int argp_parse(int argc, char *argv[])
@@ -89,12 +89,12 @@ static int argp_parse(int argc, char *argv[])
show_usage = 1;
break;
case '?':
- fprintf(stderr, "Unknown option.\n");
+ fprintf(stderr, gettext("Unknown option.\n"));
usage(progname);
return 1;
default:
- fprintf(stderr, "This should never happen!\n");
+ fprintf(stderr, gettext("This should never happen!\n"));
return 1;
}
@@ -112,7 +112,8 @@ static void list_locale()
DIR *dir = opendir(locpath);
struct dirent *pDir;
while ((pDir = readdir(dir)) != NULL){
- printf("%s.%s\n",pDir->d_name,"utf8");
+ if (strcmp(pDir->d_name,".") && strcmp(pDir->d_name,".."))
+ printf("%s\n",pDir->d_name);
}
}
}
@@ -202,8 +203,9 @@ int main(int argc, char *argv[])
fprintf (stderr, gettext ("Cannot set LC_CTYPE to default locale"));
if (setlocale (LC_MESSAGES, "") == NULL)
fprintf (stderr, gettext ("Cannot set LC_MESSAGES to default locale"));
+ bindtextdomain(PACKAGE,LOCALEDIR);
+ textdomain(PACKAGE);
/* Parse and process arguments. */
- textdomain (PACKAGE);
if (argp_parse(argc, argv))
return 1;