diff --git a/tagmanager/include/tm_source_file.h b/tagmanager/include/tm_source_file.h index bff02e307..64c36b2ae 100644 --- a/tagmanager/include/tm_source_file.h +++ b/tagmanager/include/tm_source_file.h @@ -123,6 +123,12 @@ gboolean tm_source_file_write(TMWorkObject *source_file, FILE *fp, guint attrs); */ extern guint source_file_class_id; +/*! Gets the name associated with the language index. + \param lang The language index. + \return The language name, or NULL. +*/ +const gchar *tm_source_file_get_lang_name(gint lang); + #ifdef __cplusplus } #endif diff --git a/tagmanager/tm_source_file.c b/tagmanager/tm_source_file.c index e48efcebc..10d8688dd 100644 --- a/tagmanager/tm_source_file.c +++ b/tagmanager/tm_source_file.c @@ -200,3 +200,16 @@ gboolean tm_source_file_write(TMWorkObject *source_file, FILE *fp, guint attrs) } return TRUE; } + +const gchar *tm_source_file_get_lang_name(gint lang) +{ + if (NULL == LanguageTable) + { + initializeParsing(); + installLanguageMapDefaults(); + if (NULL == TagEntryFunction) + TagEntryFunction = tm_source_file_tags; + } + return getLanguageName(lang); +} +