Example #1
0
File: js.py Project: amxn/reddit
    def build(self, closure):
        Module.build(self, closure)

        reddit_source = open(self.path).read()
        string_keys = re.findall("r\.strings\.([\w$_]+)", reddit_source)

        print >> sys.stderr, "Creating language-specific files:"
        for lang in get_available_languages():
            strings = StringsSource(lang, string_keys)
            source = strings.get_source()
            lang_path = LocalizedModule.languagize_path(self.path, lang)

            # make sure we're not rewriting a different mangled file
            # via symlink
            if os.path.islink(lang_path):
                os.unlink(lang_path)

            with open(lang_path, "w") as out:
                print >> sys.stderr, "  " + lang_path
                out.write(reddit_source+source)
Example #2
0
File: js.py Project: tjr1351/reddit
    def build(self, closure):
        Module.build(self, closure)

        reddit_source = open(self.path).read()
        string_keys = re.findall("r\.strings\.([\w$_]+)", reddit_source)

        print >> sys.stderr, "Creating language-specific files:"
        for lang in get_available_languages():
            strings = StringsSource(lang, string_keys)
            source = strings.get_source()
            lang_path = LocalizedModule.languagize_path(self.path, lang)

            # make sure we're not rewriting a different mangled file
            # via symlink
            if os.path.islink(lang_path):
                os.unlink(lang_path)

            with open(lang_path, "w") as out:
                print >> sys.stderr, "  " + lang_path
                out.write(reddit_source + source)
Example #3
0
File: js.py Project: amxn/reddit
 def outputs(self):
     languages = get_available_languages()
     for lang in languages:
         yield LocalizedModule.languagize_path(self.path, lang)
Example #4
0
File: js.py Project: tjr1351/reddit
 def outputs(self):
     languages = get_available_languages()
     for lang in languages:
         yield LocalizedModule.languagize_path(self.path, lang)