2015-01-08 08:01:45 -06:00
|
|
|
import os
|
|
|
|
import languageHandler
|
2015-01-18 17:19:39 -06:00
|
|
|
import logging
|
|
|
|
log = logging.getLogger("mysc.localization")
|
2014-10-27 16:29:04 -06:00
|
|
|
|
|
|
|
def get(rootFolder):
|
2015-01-18 17:19:39 -06:00
|
|
|
log.debug("Getting documentation folder. RootFolder: %s" % (rootFolder,))
|
2015-01-08 08:01:45 -06:00
|
|
|
defaultLocale = languageHandler.curLang
|
|
|
|
if len(defaultLocale) > 2:
|
|
|
|
defaultLocale = defaultLocale[:2]
|
2015-01-18 17:19:39 -06:00
|
|
|
log.debug("Locale: %s" % (defaultLocale,))
|
2014-10-27 16:29:04 -06:00
|
|
|
if os.path.exists(rootFolder+"/"+defaultLocale):
|
|
|
|
return defaultLocale
|
|
|
|
else:
|
2015-01-18 17:19:39 -06:00
|
|
|
log.debug("The folder does not exist, using the English folder...")
|
2014-10-27 16:29:04 -06:00
|
|
|
return "en"
|
|
|
|
|