Audacity  2.2.0
Languages.cpp File Reference

Determine installed languages. More...

#include "Audacity.h"
#include <wx/defs.h>
#include <wx/hashmap.h>
#include <wx/intl.h>
#include "Languages.h"
#include "AudacityApp.h"

Functions

 WX_DECLARE_STRING_HASH_MAP (wxString, LangHash)
 
static bool TranslationExists (wxArrayString &audacityPathList, wxString code)
 
wxString GetSystemLanguageCode ()
 
void GetLanguages (wxArrayString &langCodes, wxArrayString &langNames)
 

Detailed Description

Determine installed languages.

Figure out what translations are installed and return a list of language codes (like "es", "fr", or "pt-br") and corresponding language names (like "Español", "Français", and "Português"). We use our own list of translations of language names (i.e. "Français" instead of "French") but we fallback on the language name in wxWidgets if we don't have it listed.

This code is designed to work well with all of the current languages, but adapt to any language that wxWidgets supports. Other languages will only be supported if they're added to the database using wxLocale::AddLanguage.

But for the most part, this means that somebody could add a NEW translation and have it work immediately.

Function Documentation

void GetLanguages ( wxArrayString &  langCodes,
wxArrayString &  langNames 
)
static bool TranslationExists ( wxArrayString &  audacityPathList,
wxString  code 
)
static
WX_DECLARE_STRING_HASH_MAP ( wxString  ,
LangHash   
)