2 * Copyright (C) 2012 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 #include "imv_lang_string.h"
18 #include <utils/debug.h>
21 * Described in header.
23 char* imv_lang_string_select_lang(enumerator_t
*language_enumerator
,
24 char* languages
[], int lang_count
)
30 while (language_enumerator
->enumerate(language_enumerator
, &lang
))
32 for (i
= 0; i
< lang_count
; i
++)
34 if (streq(lang
, languages
[i
]))
46 return languages
[i_chosen
];
50 * Described in header.
52 char* imv_lang_string_select_string(imv_lang_string_t lang_string
[], char *lang
)
62 string
= lang_string
[0].string
;
63 while (lang_string
[i
].lang
)
65 if (streq(lang
, lang_string
[i
].lang
))
67 string
= lang_string
[i
].string
;