summaryrefslogtreecommitdiff
path: root/src/lib/evas/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evas/common')
-rw-r--r--src/lib/evas/common/language/evas_language_utils.c25
-rw-r--r--src/lib/evas/common/language/evas_language_utils.h3
2 files changed, 28 insertions, 0 deletions
diff --git a/src/lib/evas/common/language/evas_language_utils.c b/src/lib/evas/common/language/evas_language_utils.c
index 7d13965..737b510 100644
--- a/src/lib/evas/common/language/evas_language_utils.c
+++ b/src/lib/evas/common/language/evas_language_utils.c
@@ -156,6 +156,31 @@ evas_common_language_from_locale_get(void)
156 return ""; 156 return "";
157} 157}
158 158
159const char *
160evas_common_language_from_locale_full_get(void)
161{
162 static char lang[32];
163 if (*lang) return lang;
164
165 const char *locale;
166 locale = setlocale(LC_MESSAGES, NULL);
167 if (locale && *locale)
168 {
169 size_t i;
170 for (i = 0 ; locale[i] ; i++)
171 {
172 const char c = locale[i];
173 if ((c == '.') || (c == '@') || (c == ' ')) /* Looks like en_US.UTF8 or de_DE@euro or aa_ER UTF-8*/
174 break;
175 }
176 strncpy(lang, locale, i);
177 lang[i] = '\0';
178 return lang;
179 }
180
181 return "";
182}
183
159/* 184/*
160 * @} 185 * @}
161 */ 186 */
diff --git a/src/lib/evas/common/language/evas_language_utils.h b/src/lib/evas/common/language/evas_language_utils.h
index fa795ec..5e24912 100644
--- a/src/lib/evas/common/language/evas_language_utils.h
+++ b/src/lib/evas/common/language/evas_language_utils.h
@@ -128,5 +128,8 @@ evas_common_language_char_script_get(Eina_Unicode unicode);
128 128
129const char * 129const char *
130evas_common_language_from_locale_get(void); 130evas_common_language_from_locale_get(void);
131
132const char *
133evas_common_language_from_locale_full_get(void);
131#endif 134#endif
132 135