Create page title in all other languages with cms.api.create_title()
14288
def create_title(self, page):
        
        for language_code, lang_name in iter_languages(self.languages):
            try:
                title = Title.objects.get(page=page, language=language_code)
            except Title.DoesNotExist:
                slug = self.get_slug(language_code, lang_name)
                assert slug != "", "No slug for %r" % language_code
                title = create_title(
                    language=language_code,
                    title=self.get_title(language_code, lang_name),
                    page=page,
                    slug=slug,
                )
                log.debug("Title created: %s", title)
            else:
                log.debug("Page title exist: %s", title)
1081944
def generate_page_title(self, data_slug):
        """"""
        tag = Tag.objects.filter(slug=data_slug)
        return tag[0].word
786292
def get_language_title(language_code):
    
    from parler import appsettings
    # Avoid weird lookup errors.
    if not language_code:
        raise ValueError("Missing language_code in get_language_title()")

    if appsettings.PARLER_SHOW_EXCLUDED_LANGUAGE_TABS:
        # this allows to edit languages that are not enabled in current project but are already
        # in database
        languages = ALL_LANGUAGES_DICT
    else:
        languages = LANGUAGES_DICT

    try:
        return _(languages[language_code])
    except KeyError:
        language_code = language_code.split('-')[0]  # e.g. if fr-ca is not supported fallback to fr
        language_title = languages.get(language_code, None)
        if language_title is not None:
            return _(language_title)
        else:
            return language_code
886172
def title(self, language=None, fallback=True):
        
        if not language:
            language = settings.PAGE_DEFAULT_LANGUAGE

        return self.get_content(language, 'title', language_fallback=fallback)
1072664
def titleify(self, lang='en', allwords=False, lastword=True):
        """"""
        if lang in LOWERCASE_WORDS:
            lc_words = LOWERCASE_WORDS[lang]
        else:
            lc_words = []
        s = str(self).strip()
        l = re.split(r"([_\W]+)", s)
        for i in range(len(l)):
            l[i] = l[i].lower()
            if (
                allwords == True
                or i == 0
                or (lastword == True and i == len(l) - 1)
                or l[i].lower() not in lc_words
            ):
                w = l[i]
                if len(w) > 1:
                    w = w[0].upper() + w[1:]
                else:
                    w = w.upper()
                l[i] = w
        s = "".join(l)
        return String(s)
88242
def index
      core__set_header_active_page_title(LANGUAGES[:lato_blog][:pages][:categories])
      # find categories to show
      @categories = LatoBlog::Category.where(meta_language: cookies[:lato_blog__current_language]).order('title ASC')
      @widget_index_categories = core__widgets_index(@categories, search: 'title', pagination: 10)
    end
1202893
def _page_to_title(page):
  
  # print("page=%s" % page)
  start_tag = u"<title>"
  end_tag = u"</title>"
  start_pos = page.find(start_tag)
  end_pos = page.find(end_tag)
  assert start_pos != -1
  assert end_pos != -1
  start_pos += len(start_tag)
  return page[start_pos:end_pos]
583182
def edit
      core__set_header_active_page_title(LANGUAGES[:lato_blog][:pages][:tags_edit])
      @tag = LatoBlog::Tag.find_by(id: params[:id])
      return unless check_tag_presence

      if @tag.meta_language != cookies[:lato_blog__current_language]
        set_current_language @tag.meta_language
      end
    end
333921
protected function saveLocalizationCommonAction()
	{
		$localization = $this->getPageLocalization();

		if ($this->getRequestInput()->has('title')) {
			
			$title = trim($this->getRequestParameter('title'));

			if (empty($title)) {
				throw new CmsException(null, 'Title cannot be empty.');
			}

			$localization->setTitle($title);
		}
	}
897227
def get_title(self, lang: str=None) -> Literal:
        
        return self.metadata.get_single(key=DC.title, lang=lang) or \
            self.metadata.get_single(key=DCT.title, lang=lang)
933432
def core__get_menu_title_translation title, module_name
      return title if (!title.start_with?('translate'))

      title_key = core__get_string_inside_strings(title, '[', ']')
      module_languages = core__get_module_languages(module_name)
      return title if !module_languages || !module_languages[:menu] || !module_languages[:menu][title_key]

      return module_languages[:menu][title_key]
    end
992097
def create_article(tree, template, title, language, slug=None, description=None,
                   page_title=None, menu_title=None, meta_description=None,
                   created_by=None, image=None, publication_date=None, publication_end_date=None,
                   published=False, login_required=False, creation_date=None, categories=[]):
    

    # validate tree
    tree = tree.get_public_object()
    assert tree.application_urls == 'CMSArticlesApp'

    # validate template
    assert template in [tpl[0] for tpl in settings.CMS_ARTICLES_TEMPLATES]
    get_template(template)

    # validate language:
    assert language in get_language_list(tree.node.site_id), settings.CMS_LANGUAGES.get(tree.node.site_id)

    # validate publication date
    if publication_date:
        assert isinstance(publication_date, datetime.date)

    # validate publication end date
    if publication_end_date:
        assert isinstance(publication_end_date, datetime.date)

    # validate creation date
    if not creation_date:
        creation_date = publication_date
    if creation_date:
        assert isinstance(creation_date, datetime.date)

    # get username
    if created_by:
        try:
            username = created_by.get_username()
        except Exception:
            username = force_text(created_by)
    else:
        username = 'script'

    with current_user(username):
        # create article
        article = Article.objects.create(
            tree=tree,
            template=template,
            login_required=login_required,
            creation_date=creation_date,
            publication_date=publication_date,
            publication_end_date=publication_end_date,
            languages=language,
        )
        for category in categories:
            article.categories.add(category)

        # create title
        create_title(
            article=article,
            language=language,
            title=title,
            slug=slug,
            description=description,
            page_title=page_title,
            menu_title=menu_title,
            meta_description=meta_description,
            creation_date=creation_date,
            image=image,
        )

        # publish article
        if published:
            article.publish(language)

    return article.reload()
267208
void renderFormContent() {

        initLocaleSelect();
        setNativeResourceInfo(m_sitePath, m_locale);
        m_contentInfoHeader = new CmsInfoHeader(m_title, null, m_sitePath, m_locale, m_iconClasses);
        m_basePanel.add(m_contentInfoHeader);
        SimplePanel content = new SimplePanel();
        content.setStyleName(org.opencms.acacia.client.css.I_CmsLayoutBundle.INSTANCE.form().formParent());
        m_basePanel.add(content);
        initEntityObserver();
        if (m_definitions.get(m_locale).hasEditorChangeHandlers()) {
            initEditorChangeHandlers(m_definitions.get(m_locale).getEditorChangeScopes());
        }
        renderEntityForm(m_entityId, m_tabInfos, content, m_basePanel.getElement());
        if ((m_clientId != null) && (getFormTabs() != null)) {

            CmsListInfoBean pageInfo = CmsContainerpageController.get().getData().getPageInfo();
            m_pageInfoHeader = new CmsInfoHeader(
                pageInfo.getTitle(),
                null,
                pageInfo.getSubTitle(),
                CmsContainerpageController.get().getData().getLocale(),
                pageInfo.getBigIconClasses());
            updateInfoHeader(CmsContentDefinition.SETTINGS_TAB_ID.equals(getFormTabs().getSelectedId()));
            getFormTabs().addSelectionHandler(new SelectionHandler<Integer>() {

                public void onSelection(SelectionEvent<Integer> event) {

                    updateInfoHeader(CmsContentDefinition.SETTINGS_TAB_ID.equals(getFormTabs().getSelectedId()));
                }
            });
        }
    }
751864
protected function setTitleEditPage()
    {
        if (isset($this->data_page['page_id'])) {
            $title = $this->text('Edit %name', array('%name' => $this->data_page['title']));
        } else {
            $title = $this->text('Add page');
        }

        $this->setTitle($title);
    }
1038744
public function pageTitle($name = 'default', $language = null, $treeNode = null, Siteroot $siteroot = null)
    {
        $request = $this->requestStack->getCurrentRequest();

        if ($siteroot === null) {
            $siteroot = $request->attributes->get('siterootUrl')->getSiteroot();
        }

        if ($treeNode instanceof ContentTreeContext) {
            $treeNode = $treeNode->getNode();
        }

        if (!($treeNode instanceof TreeNodeInterface)) {
            $treeNode = $request->get('contentDocument');
        }

        if ($language === null) {
            $language = $request->getLocale();
        }

        $title = $this->patternResolver->replace(
            $name,
            $siteroot,
            $treeNode->getTree()->getContent($treeNode),
            $language
        );

        return $title;
    }
357979
private String messagePageTitle() {

        return org.opencms.gwt.Messages.get().getBundle(getLocale()).key(
            org.opencms.gwt.Messages.GUI_DEPENDENCY_PAGE_TITLE_0);
    }
96837
def create_title_page(self, filename, title=''):
        
        fobj = open(filename, "w")
        fobj.write(self.header % (title, self.style))

        fobj.write("<h1>%s</h1>\n" % title)
        fobj.write("<h2>Memory distribution over time</h2>\n")
        fobj.write(self.charts['snapshots'])

        fobj.write("<h2>Snapshots statistics</h2>\n")
        fobj.write('<table id="nb">\n')

        classlist = list(self.index.keys())
        classlist.sort()

        for snapshot in self.snapshots:
            fobj.write('<tr><td>\n')
            fobj.write('<table id="tl" rules="rows">\n')
            fobj.write("<h3>%s snapshot at %s</h3>\n" % (
                snapshot.desc or 'Untitled',
                pp_timestamp(snapshot.timestamp)
            ))

            data = {}
            data['sys']      = pp(snapshot.system_total.vsz)
            data['tracked']  = pp(snapshot.tracked_total)
            data['asizeof']  = pp(snapshot.asizeof_total)
            data['overhead'] = pp(getattr(snapshot, 'overhead', 0))

            fobj.write(self.snapshot_summary % data)

            if snapshot.tracked_total:
                fobj.write(self.snapshot_cls_header)
                for classname in classlist:
                    data = snapshot.classes[classname].copy()
                    data['cls'] = '<a href="%s">%s</a>' % (self.relative_path(self.links[classname]), classname)
                    data['sum'] = pp(data['sum'])
                    data['avg'] = pp(data['avg'])
                    fobj.write(self.snapshot_cls % data)
            fobj.write('</table>')
            fobj.write('</td><td>\n')
            if snapshot.tracked_total:
                fobj.write(self.charts[snapshot])
            fobj.write('</td></tr>\n')

        fobj.write("</table>\n")
        fobj.write(self.footer)
        fobj.close()