on import translations
552810
public function onImportTranslations()
    {
        $this->onTranslationList();
        $this->breadcrumbs->register('translations-import', function($breadcrumbs) {
            $breadcrumbs->parent('translations');
            $breadcrumbs->push('Import translations');
        });
        $this->shareOnView('translations-import');
    }
199853
def open_imports(self, imported_definitions):
        """"""
        for imp in self.imports:
            imp.load(self, imported_definitions)
683432
def visit_importfrom(self, node):
        """"""
        return "from %s import %s" % (
            "." * (node.level or 0) + node.modname,
            _import_string(node.names),
        )
610071
def extract_translations(self, string):
        """"""

        tree = ast.parse(string)
        # ast_visit(tree)
        visitor = TransVisitor(
            self.tranz_functions,
            self.tranzchoice_functions)
        visitor.visit(tree)

        return visitor.translations
206268
function getImports(sourceFile) {
    var imports = [];
    handleNode(sourceFile);

    function handleNode(node) {
        switch (node.kind) {
            case ts.SyntaxKind.ImportDeclaration:
                imports.push(node.moduleSpecifier.text);
                break;
            case ts.SyntaxKind.ImportEqualsDeclaration:
                imports.push(node.moduleReference.expression.text);
                break;
        }
        ts.forEachChild(node, handleNode);
    }
    return imports;
}
1318799
def autodiscover():
    
    import os
    import sys
    import copy
    from django.utils.module_loading import module_has_submodule
    from modeltranslation.translator import translator
    from modeltranslation.settings import TRANSLATION_FILES, DEBUG

    from importlib import import_module
    from django.apps import apps
    mods = [(app_config.name, app_config.module) for app_config in apps.get_app_configs()]

    for (app, mod) in mods:
        # Attempt to import the app's translation module.
        module = '%s.translation' % app
        before_import_registry = copy.copy(translator._registry)
        try:
            import_module(module)
        except:
            # Reset the model registry to the state before the last import as
            # this import will have to reoccur on the next request and this
            # could raise NotRegistered and AlreadyRegistered exceptions
            translator._registry = before_import_registry

            # Decide whether to bubble up this error. If the app just
            # doesn't have an translation module, we can ignore the error
            # attempting to import it, otherwise we want it to bubble up.
            if module_has_submodule(mod, 'translation'):
                raise

    for module in TRANSLATION_FILES:
        import_module(module)

    # In debug mode, print a list of registered models and pid to stdout.
    # Note: Differing model order is fine, we don't rely on a particular
    # order, as far as base classes are registered before subclasses.
    if DEBUG:
        try:
            if sys.argv[1] in ('runserver', 'runserver_plus'):
                models = translator.get_registered_models()
                names = ', '.join(m.__name__ for m in models)
                print('modeltranslation: Registered %d models for translation'
                      ' (%s) [pid: %d].' % (len(models), names, os.getpid()))
        except IndexError:
            pass
793858
def visit_Import(self, node):
        """"""
        line = self._code_lines[node.lineno - 1]
        module_name = line.split("import")[0].strip()
        for name in node.names:
            imported_name = name.name
            if name.asname:
                imported_name = name.asname + "::" + imported_name
            self.imported_namespaces[imported_name] = module_name
793782
private static function translator()
    {
        $files = ['Lang', 'Smiley'];
        $folder = static::$root.'Translator'.'/';

        self::call($files, $folder);

        $files = ['LanguageKeyNotFoundException', 'LanguageNotSupportedException'];
        $folder = static::$root.'Translator/Exceptions'.'/';

        self::call($files, $folder);
    }
605335
function Translations (params, translations) {

  /** @type {Object} Store current translations source */
  this._translations = {};
  /** @type {Object} Store current stats for latest merge request */
  this._stats = {};
  /** @type {Object} Set default parameters */
  this.params = _.defaults(params, {
    "tree": false,
    "safeMode": false,
    "nullEmpty": false
  });
  // Set translations if given as parameter
  this.setTranslations(translations);
  // Initialize statistics
  this.initStats();

}
954438
def add_translations(
        self, module_name, translations_dir="translations", domain="messages"
    ):
        
        module = importlib.import_module(module_name)
        for path in (Path(p, translations_dir) for p in module.__path__):
            if not (path.exists() and path.is_dir()):
                continue

            if not os.access(str(path), os.R_OK):
                self.app.logger.warning(
                    "Babel translations: read access not allowed {}, skipping."
                    "".format(repr(str(path).encode("utf-8")))
                )
                continue

            self._translations_paths.append((str(path), domain))
643002
function translate(key, options, hasOwnOptions) {

			var lng = options.lng || 'auto';

			if (!translations[lng]) {
				translations[lng] = {};
			}

			if (!t) {
				translations[lng][key] = key;
			} else if (!translations[lng][key] || hasOwnOptions) {
				translations[lng][key] = t(key, options);
			}

		}
166479
def translate(self):
        """"""
        visitor = CheckTranslator(self.document,
                                  contents=self.contents,
                                  filename=self.filename,
                                  ignore=self.ignore)
        self.document.walkabout(visitor)
        self.checkers += visitor.checkers
844975
def get_translations(self, language=None):
        
        from .models import Translation

        if not self.pk:
            return Translation.objects.none()

        return Translation.objects.get_translations(obj=self, language=language)
1147912
def update_translations(ctx, module_list):
    
    if not module_list:
        raise AnthemError(u"You have to provide a list of "
                          "module's name to update the translations")

    for module in module_list:
        ctx.env['ir.module.module'].with_context(overwrite=True).search(
            [('name', '=', module)]).update_translations()
130486
def get_imports(filename):
    
    with open(filename, "rb") as f:
        src = f.read()
    finder = ImportFinder()
    finder.visit(ast.parse(src, filename=filename))
    imports = []
    for i in finder.imports:
        name, _, is_from, is_star = i
        imports.append(i + (resolve_import(name, is_from, is_star),))
    return imports
578143
function translate(load){
			var filename;
			//!steal-remove-start
			filename = getFilename(load.name);
			//!steal-remove-end

			var result = parse(load.source, this, zoneOpts);

			// Add any import specifiers to the load.
			addImportSpecifiers(load, result);
			load.metadata.originalSource = load.source;

			// Register dynamic imports for the slim loader config
			var localLoader = loader.localLoader || loader;
			if (localLoader.slimConfig) {
				localLoader.slimConfig.needsDynamicLoader = true;

				var toMap = localLoader.slimConfig.toMap;
				Array.prototype.push.apply(toMap, result.rawImports);
				Array.prototype.push.apply(toMap, result.dynamicImports);
			}

			// For live-reload, determine if we should reload the viewModel
			hasDynamicImports = result.dynamicImports.length > 0;

			return Promise.all([
				addBundles(result.dynamicImports, load.name),
				Promise.all(result.imports)
			]).then(function(pResults){
				var exportedValuesDef = Object.keys(result.ases)
				.map(function(name){
					return "\"" + name + "\": {\n" +
					"\t\t\tenumerable: true,\n" +
					"\t\t\tconfigurable: true,\n" +
					"\t\t\twritable: true,\n" +
					"\t\t\tvalue: " + name + "['default'] || " + name + "\n" +
					"\t\t}";
				}).join(",\n");

				var output = template({
					imports: JSON.stringify(pResults[1]),
					isDevelopment: isDevelopment || false,
					routeData: result.viewModel.routeData || "",
					args: result.args.join(", "),
					zoneOpts: JSON.stringify(zoneOpts),
					intermediate: JSON.stringify(result.intermediate),
					ases: exportedValuesDef ? exportedValuesDef + "," : "",
					filename: filename
				});

				return output;
			});
		}
295525
def lazy_translations(cls):
        """"""
        return {
            cloudfiles.errors.NoSuchContainer: errors.NoContainerException,
            cloudfiles.errors.NoSuchObject: errors.NoObjectException,
        }