Return the human readable URL for the page.

 Posible options values are
 <tt>:locale</tt>::
     A locale given in the Humpyard::Config.locales.
     If no <tt>:locale</tt> is given the option will be ::I18n.locale by default
482050
def human_url(options={})
      options[:locale] ||= ::I18n.locale
      options[:format] ||= :html
      
      unless Humpyard::config.locales.include? options[:locale].to_sym
        options[:locale] = Humpyard::config.locales.first
      end
      
      if options[:path_format]
        format = "/"
      else
        format = ".#{options[:format].to_s}" 
      end
      
      if self.title_for_url == 'index' or self.is_root_page?
        "/#{Humpyard::config.parsed_www_prefix(options).gsub(/[^\/]*$/, '')}"
      else
        "/#{Humpyard::config.parsed_www_prefix(options)}#{((self.ancestors.reverse + [self]).collect{|p| p.query_title_for_url(options[:locale])} - ['index']) * '/'}#{format}".gsub(/^index\//,'')
      end
    end
385407
def locale(qsetting=''):
    
    override_flag = QSettings(qsetting).value(
        'locale/overrideFlag', True, type=bool)

    default = 'en_US'

    if override_flag:
        locale_name = QSettings(qsetting).value(
            'locale/userLocale', default, type=str)
    else:
        # noinspection PyArgumentList
        locale_name = QLocale.system().name()

    if locale_name == 'C':
        # On travis, locale/userLocale is equal to C. We want 'en'.
        locale_name = default

    # NOTES: we split the locale name because we need the first two
    # character i.e. 'id', 'af, etc
    locale_name = str(locale_name).split('_')[0]
    return locale_name
270562
def get_language_parameter(request, query_language_key='language', object=None, default=None):
    
    # This is the same logic as the django-admin uses.
    # The only difference is the origin of the request parameter.
    if not is_multilingual_project():
        # By default, the objects are stored in a single static language.
        # This makes the transition to multilingual easier as well.
        # The default language can operate as fallback language too.
        return default or appsettings.PARLER_LANGUAGES.get_default_language()
    else:
        # In multilingual mode, take the provided language of the request.
        code = request.GET.get(query_language_key)

        if not code:
            # forms: show first tab by default
            code = default or appsettings.PARLER_LANGUAGES.get_first_language()

        return normalize_language_code(code)
861569
protected String getDetailLink(CmsResource pageRes, CmsResource detailRes, Locale locale) {

        String pageSitePath = m_siteGuestCms.getSitePath(pageRes);
        String detailSitePath = m_siteGuestCms.getSitePath(detailRes);
        CmsRequestContext requestContext = m_siteGuestCms.getRequestContext();
        String originalUri = requestContext.getUri();
        Locale originalLocale = requestContext.getLocale();
        try {
            requestContext.setUri(pageSitePath);
            requestContext.setLocale(locale);
            return OpenCms.getLinkManager().getOnlineLink(m_siteGuestCms, detailSitePath, true);
        } finally {
            requestContext.setUri(originalUri);
            requestContext.setLocale(originalLocale);
        }
    }
1147392
def choose_locale(self, locale: Text) -> Text:
        

        if locale not in self._choice_cache:
            locales = self.list_locales()

            best_choice = locales[0]
            best_level = 0

            for candidate in locales:
                cmp = compare_locales(locale, candidate)

                if cmp > best_level:
                    best_choice = candidate
                    best_level = cmp

            self._choice_cache[locale] = best_choice

        return self._choice_cache[locale]
1287171
def get_page_text_url(self, page):
        
        template = self.resources.page.get('text')
        url = template.replace("{page}", str(page))
        return url
177619
def get_browser_locale(self):
        '''
        
        '''
        locale_id = self.get_cookie('blocale')
        if locale_id:
            return tornado.locale.get(locale_id)
        else:
            return tornado.locale.get('en_US')
492100
def set_default_url_option_for_request?
      RailsLocaleDetection.set_default_url_option === true || RailsLocaleDetection.set_default_url_option == :always || RailsLocaleDetection.set_default_url_option == :explicitly && params[locale_key].present?
    end
1061156
public function uri($locale = null)
    {
        $uri = $this->page->uri($locale).'#'.$this->position.'-'.$this->translate('slug', $locale);

        return $uri;
    }
383362
def generate_with_i18n_routing(method, params = {}, recall = {}, options = {})
      return nil if @locale and @locale != I18n.locale.to_sym
      generate_without_i18n_routing(method, params, recall, options)
    end
469258
def get_locale(self, language=None, country=None, variant=None):
        
        # http://www.openoffice.org/api/docs/common/ref/com/sun/star/lang/Locale.html
        locale = uno.createUnoStruct('com.sun.star.lang.Locale')
        if language:
            locale.Language = language
        if country:
            locale.Country = country
        if variant:
            locale.Variant = variant
        formats = self._target.getNumberFormats()
        return Locale(locale, formats)
1026576
async def get_locale(self) -> Text:
        

        if self._locale_override:
            return self._locale_override
        else:
            return await self.user.get_locale()
358536
def i18n_get_path():
    
    local_locale_path = client_get_path() / 'locale'
    if platform.system() == 'Linux':
        if local_locale_path.exists():
            return local_locale_path
        else:
            return Path('/usr/share/locale')
    else:
        return local_locale_path
26778
def user_preferred_languages
      return [] if header.to_s.strip.empty?
      @user_preferred_languages ||= begin
        header.to_s.gsub(/\s+/, '').split(',').map do |language|
          locale, quality = language.split(';q=')
          raise ArgumentError, 'Not correctly formatted' unless locale =~ /^[a-z\-0-9]+|\*$/i

          locale  = locale.downcase.gsub(/-[a-z0-9]+$/i, &:upcase) # Uppercase territory
          locale  = nil if locale == '*' # Ignore wildcards

          quality = quality ? quality.to_f : 1.0

          [locale, quality]
        end.sort do |(_, left), (_, right)|
          right <=> left
        end.map(&:first).compact
      rescue ArgumentError # Just rescue anything if the browser messed up badly.
        []
      end
    end
337948
def order_link(order, options = {})
      link_to t("#{options[:i18n_scope]}.#{order}"), url_for(params.to_unsafe_h.merge(page: nil, order: order)), data: { order: order }, remote: true
    end
80459
def get_public_cms_page_urls(*, language_code):
    
    pages = Page.objects.public()
    urls = [page.get_absolute_url(language=language_code) for page in pages]
    urls.sort()
    return tuple(urls)
1311287
private void doGetLocales() throws PageException {
	Struct sct = new StructImpl(StructImpl.TYPE_LINKED);
	// Array arr=new ArrayImpl();
	String strLocale = getString("locale", "english (united kingdom)");
	Locale locale = LocaleFactory.getLocale(strLocale);
	pageContext.setVariable(getString("admin", action, "returnVariable"), sct);
	Map locales = LocaleFactory.getLocales();
	Iterator it = locales.keySet().iterator();

	String key;
	Locale l;
	while (it.hasNext()) {
	    key = (String) it.next();
	    l = (Locale) locales.get(key);
	    sct.setEL(l.toString(), l.getDisplayName(locale));
	    // arr.append(locale.getDisplayName());
	}
	// arr.sort("textnocase","asc");
    }