Esempio n. 1
0
from subprocess import call

UNTANGLE_DIR = '%s/lib/python' % (os.path.dirname(os.path.realpath(__file__)))
sys.path.insert(0, UNTANGLE_DIR)

import i18n

reload(sys)
sys.setdefaultencoding('utf8')

ngfw = i18n.Ngfw()
languages = i18n.Languages()

pot_file_name = "pot/en/untangle-en.pot"
pot = i18n.PotFile(language="en", file_name=pot_file_name)


def main(argv):
    """
    Main entry for generate
    """
    global pot
    language_ids = languages.get_enabled_ids()

    try:
        opts, args = getopt.getopt(argv, "hpl:d",
                                   ["help", "language=", "debug"])
    except getopt.GetoptError:
        usage()
        sys.exit(2)
Esempio n. 2
0
from subprocess import call

UNTANGLE_DIR = '%s/lib/python' % (os.path.dirname(os.path.realpath(__file__)))
sys.path.insert(0, UNTANGLE_DIR)

import i18n

Debug=False

reload(sys)  
sys.setdefaultencoding('utf8')

ngfw = i18n.Ngfw()
languages = i18n.Languages()

pot = i18n.PotFile(language="en", file_name="/tmp/generated.pot")
# pot = i18n.PotFile(language="en", file_name="pot/en/untangle-en.pot")
pot_file_name = "pot/en/untangle-en.pot"

def get_keys(module):
    """
	Walk source trees and pull text appropriately from
	different types of files
    """
    global pot
    module_source_directory = ngfw.get_module_directory(module)

    full_file_name = None
    for root, dir_names, file_names in os.walk(module_source_directory):

        for file_name in fnmatch.filter(file_names, '*.json'):