more rendering corrections
[AROS.git] / workbench / libs / lowlevel / getlanguageselection.c
blobb1dc1481a09928523cdd232f9b0544941edebe33
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
9 #include <string.h>
10 #include <aros/libcall.h>
11 #include <exec/types.h>
12 #include <libraries/lowlevel.h>
13 #include <libraries/locale.h>
14 #include <proto/locale.h>
16 #include "lowlevel_intern.h"
19 * Put those in the same order as the LANG_* defines in libraries/lowlevel.h
21 static char * langlist[] =
23 "American",
24 "English",
25 "Deutsch",
26 "Français",
27 "Español",
28 "Italiano",
29 "Português",
30 "Dansk",
31 "Nederlands",
32 "Norsk",
33 "Suomi",
34 "Svenska",
35 "Japanese",
36 "Chinese",
37 "Arabic",
38 "Greek",
39 "Hebrew",
40 "Korean",
41 NULL
44 /*****************************************************************************
46 NAME */
48 AROS_LH0(ULONG, GetLanguageSelection,
50 /* SYNOPSIS */
52 /* LOCATION */
53 struct LowLevelBase *, LowLevelBase, 6, LowLevel)
55 /* NAME
57 FUNCTION
59 INPUTS
61 RESULT
63 BUGS
65 INTERNALS
67 HISTORY
69 *****************************************************************************/
71 AROS_LIBFUNC_INIT
73 int index = 0;
75 * Get the default locale
77 struct Locale * locale = OpenLocale("");
79 if (NULL == locale)
80 return LANG_UNKNOWN;
82 while (NULL != langlist[index])
84 if (0 == strcmp(locale->loc_LanguageName,(char *)langlist[index]))
86 CloseLocale(locale);
87 return index+1;
89 index++;
92 CloseLocale(locale);
93 return LANG_UNKNOWN;
95 AROS_LIBFUNC_EXIT
96 } /* GetLanguageSelection */