Populate the IDs of the snippet languages returned by snippetLanguagesIncluded()
435109
protected function populateLanguageIDs() {
        $this->_cache_language_ids=array();
        if($snippetLanguages=$this->snippetLanguagesIncluded()) {
            // And keep a record of parents we don't need to get
            // parents of themselves, as well as IDs to mark
            foreach($snippetLanguages as $langId) {
                $this->_cache_language_ids[$langId]=true;
            }
        }
    }
451603
def translation_ids
      query = Translation.all
      query = query.where(lang: lang) unless lang.blank?
      query = query.joins(:translation_key).where("translation_center_translation_keys.name LIKE ?", "%#{translation_key_name}%") unless translation_key_name.blank?

      if translator_identifier
        translator_class = TranslationCenter::CONFIG['translator_type'].camelize.constantize
        translators_ids = translator_class.where("#{TranslationCenter::CONFIG['identifier_type']} LIKE ? ", "%#{translator_identifier}%").map(&:id)

        query = query.where(translator_id: translators_ids)
      end

      query.map(&:id)
    end
344077
public function getExcludedIds()
    {
        $excludedIdsString = $this->getRequest()->get('excludedIds');

        return (null !== $excludedIdsString) ? array_filter(explode(',', $excludedIdsString)) : [];
    }
1021795
function getLanguageForClass(classNames) {
    return Immutable.List(classNames)
        .map(function(cl) {
            // Markdown
            if (cl.search('lang-') === 0) {
                return cl.slice('lang-'.length);
            }

            // Asciidoc
            if (cl.search('language-') === 0) {
                return cl.slice('language-'.length);
            }

            return null;
        })
        .find(function(cl) {
            return Boolean(cl);
        });
}
238417
def process_LANGUAGE_CODE(self, language_code, data):
        '''
        
        '''
        # Dirty hack to fix non included default
        language_code = 'en-us' if language_code == 'en' else language_code
        language = translation.get_language_info('en' if language_code == 'en-us' else language_code)
        if not settings.JS_CONTEXT or 'LANGUAGE_NAME' in settings.JS_CONTEXT \
            or (settings.JS_CONTEXT_EXCLUDE and 'LANGUAGE_NAME' in settings.JS_CONTEXT_EXCLUDE):
            data['LANGUAGE_NAME'] = language['name']
        if not settings.JS_CONTEXT or 'LANGUAGE_NAME_LOCAL' in settings.JS_CONTEXT \
            or (settings.JS_CONTEXT_EXCLUDE and 'LANGUAGE_NAME_LOCAL' in settings.JS_CONTEXT_EXCLUDE):
            data['LANGUAGE_NAME_LOCAL'] = language['name_local']
        return language_code
1069368
def poll_open_file_languages(self):
        """"""
        languages = []
        for index in range(self.get_stack_count()):
            languages.append(
                self.tabs.widget(index).language.lower())
        return set(languages)
856104
def get_string(self, stringid):
        '''
        '''
        stringid = int(stringid)
        if not hasattr(self, '_strings'):
            self._strings = {}
        if not stringid in self._strings:
            self._strings[stringid] = self.addon.getLocalizedString(stringid)
        return self._strings[stringid]
558019
def extract_translations(self, string):
        """"""

        trans = []
        for t in Lexer(string.decode("utf-8"), None).tokenize():
            if t.token_type == TOKEN_BLOCK:
                if not t.contents.startswith(
                        (self.tranz_tag, self.tranzchoice_tag)):
                    continue

                is_tranzchoice = t.contents.startswith(
                    self.tranzchoice_tag +
                    " ")
                kwargs = {
                    "id": self._match_to_transvar(id_re, t.contents),
                    "number": self._match_to_transvar(number_re, t.contents),
                    "domain": self._match_to_transvar(domain_re, t.contents),
                    "locale": self._match_to_transvar(locale_re, t.contents),
                    "is_transchoice": is_tranzchoice, "parameters": TransVar(
                        [x.split("=")[0].strip() for x in properties_re.findall(t.contents) if x],
                        TransVar.LITERAL
                    ),
                    "lineno": t.lineno,
                }

                trans.append(Translation(**kwargs))
        return trans
959561
def get_missing_languages(self, field_name, db_table):
        
        db_table_fields = self.get_table_fields(db_table)
        for lang_code in AVAILABLE_LANGUAGES:
            if build_localized_fieldname(field_name, lang_code) not in db_table_fields:
                yield lang_code
702057
def get_avaliable_languages(self, bundleId):
        """"""
        bundleData = self.__get_bundle_data(bundleId)

        if not bundleData:
            return []

        sourceLanguage = bundleData.get(self.__RESPONSE_SRC_LANGUAGE_KEY)
        languages = bundleData.get(self.__RESPONSE_TARGET_LANGUAGES_KEY)
        languages.append(sourceLanguage)

        return languages if languages else []
479763
def get_page_from_string_or_id(page_string, lang=None):
    """"""
    if type(page_string) == int:
        return Page.objects.get(pk=int(page_string))
    # if we have a string coming from some templates templates
    if (isinstance(page_string, SafeText) or
            isinstance(page_string, str)):
        if page_string.isdigit():
            return Page.objects.get(pk=int(page_string))
        return Page.objects.from_path(page_string, lang)
    # in any other case we return the input becasue it's probably
    # a Page object.
    return page_string
1239343
def get_snippet_by_name(cls, name):
        """"""
        name_with_dir_separators = name.replace('.', os.path.sep)
        loaded = yaml_loader.YamlLoader.load_yaml_by_relpath(cls.snippets_dirs,
                                                             name_with_dir_separators + '.yaml')
        if loaded:
            return cls._create_snippet(name, *loaded)

        raise exceptions.SnippetNotFoundException('no such snippet: {name}'.
                                                  format(name=name_with_dir_separators))
1368748
List<Snippet> sourceToSnippetsWithWrappers(String userSource) {
        List<Snippet> snippets = sourceToSnippets(userSource);
        for (Snippet snip : snippets) {
            if (snip.outerWrap() == null) {
                snip.setOuterWrap(
                        (snip.kind() == Kind.IMPORT)
                                ? state.outerMap.wrapImport(snip.guts(), snip)
                                : state.outerMap.wrapInTrialClass(snip.guts())
                );
            }
        }
        return snippets;
    }
986550
def _get_catalog_idstrs(self):
        """"""
        if self._catalog_view == ISOLATED:
            return [str(self._catalog_id)]
        else:
            return self._get_descendent_cat_idstrs(self._catalog_id)
529993
function _getLangWithDesc( desc ) {
    const results = ( desc ) ? tags.search( desc ).filter( _languagesOnly ) : [];
    return results[ 0 ] || '';
}
419524
private function decorateSnippet(array $snippet, $locale)
    {
        return array_merge(
            $snippet,
            [
                '_links' => [
                    'self' => $this->urlGenerator->generate(
                        'get_snippet',
                        ['id' => $snippet['id'], 'language' => $locale]
                    ),
                    'delete' => $this->urlGenerator->generate(
                        'delete_snippet',
                        ['id' => $snippet['id'], 'language' => $locale]
                    ),
                    'new' => $this->urlGenerator->generate('post_snippet', ['language' => $locale]),
                    'update' => $this->urlGenerator->generate(
                        'put_snippet',
                        ['id' => $snippet['id'], 'language' => $locale]
                    ),
                ],
            ]
        );
    }
1361712
function getLanguageFilter(languageId) {
        return function languageFilter(file) {
            var id = LanguageManager.getLanguageForPath(file.fullPath).getId();
            if (typeof languageId === "string") {
                return (id === languageId);
            } else {
                return (languageId.indexOf(id) !== -1);
            }
        };
    }