Bug 1730953 - Migrate strings from browser.dtd to Fluent and remove file. r=emalysz,fluent-reviewers,flod

Differential Revision: https://phabricator.services.mozilla.com/D126372
This commit is contained in:
Niklas Baumgardner 2021-09-28 21:19:29 +00:00
Родитель 343ddbd563
Коммит 0b00664094
14 изменённых файлов: 67 добавлений и 44 удалений

Просмотреть файл

@ -1,6 +1,4 @@
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
%brandDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
%browserDTD;
<!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
%placesDTD;

Просмотреть файл

@ -17,6 +17,10 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
data-l10n-sync="true">
<linkset>
<html:link rel="localization" href="browser/appmenu.ftl"/>
</linkset>
#include macWindow.inc.xhtml
<!-- Dock menu -->
@ -27,9 +31,9 @@
<menupopup id="menu_mac_dockmenu" aria-hidden="true">
<!-- The command cannot be cmd_newNavigator because we need to activate
the application. -->
<menuitem label="&newNavigatorCmd.label;" oncommand="OpenBrowserWindowFromDockMenu();"
<menuitem data-l10n-id="appmenuitem-new-window" oncommand="OpenBrowserWindowFromDockMenu();"
id="macDockMenuNewWindow" />
<menuitem label="&newPrivateWindow.label;" oncommand="OpenBrowserWindowFromDockMenu({private: true});"
<menuitem data-l10n-id="appmenuitem-new-private-window" oncommand="OpenBrowserWindowFromDockMenu({private: true});"
id="macDockMenuNewPrivateWindow" />
</menupopup>
</popupset>

Просмотреть файл

@ -9,11 +9,6 @@
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/usercontext/usercontext.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
]>
<window id="webextpanels-window"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

Просмотреть файл

@ -11,8 +11,6 @@
<!DOCTYPE window [
<!ENTITY % editMenuDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
%editMenuDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
]>
<window id="bookmarksPanel"

Просмотреть файл

@ -11,8 +11,6 @@
<!DOCTYPE window [
<!ENTITY % editMenuDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
%editMenuDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
]>
<window id="history-panel"
@ -22,7 +20,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="HistorySidebarInit();"
onunload="PlacesUIUtils.setMouseoverURL('', window);"
aria-label="&historyButton.label;">
data-l10n-id="places-history">
<script src="chrome://browser/content/places/historySidebar.js"/>
<script src="chrome://global/content/globalOverlay.js"/>

Просмотреть файл

@ -19,8 +19,6 @@
%placesDTD;
<!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
%editMenuOverlayDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
#ifdef XP_MACOSX
#include ../../../base/content/browser-doctype.inc
#endif

Просмотреть файл

@ -24,25 +24,23 @@
static get markup() {
return `
<stringbundle src="chrome://browser/locale/search.properties"></stringbundle>
<hbox class="searchbar-search-button" tooltiptext="&searchIcon.tooltip;">
<hbox class="searchbar-search-button" data-l10n-id="searchbar-icon">
<image class="searchbar-search-icon"></image>
<image class="searchbar-search-icon-overlay"></image>
</hbox>
<html:input class="searchbar-textbox" is="autocomplete-input" type="search" placeholder="&searchInput.placeholder;" autocompletepopup="PopupSearchAutoComplete" autocompletesearch="search-autocomplete" autocompletesearchparam="searchbar-history" maxrows="10" completeselectedindex="true" minresultsforpopup="0"/>
<html:input class="searchbar-textbox" is="autocomplete-input" type="search" data-l10n-id="searchbar-input" autocompletepopup="PopupSearchAutoComplete" autocompletesearch="search-autocomplete" autocompletesearchparam="searchbar-history" maxrows="10" completeselectedindex="true" minresultsforpopup="0"/>
<menupopup class="textbox-contextmenu"></menupopup>
<hbox class="search-go-container">
<image class="search-go-button urlbar-icon" hidden="true" onclick="handleSearchCommand(event);" tooltiptext="&contentSearchSubmit.tooltip;"></image>
<image class="search-go-button urlbar-icon" hidden="true" onclick="handleSearchCommand(event);" data-l10n-id="searchbar-submit"></image>
</hbox>
`;
}
static get entities() {
return ["chrome://browser/locale/browser.dtd"];
}
constructor() {
super();
MozXULElement.insertFTLIfNeeded("browser/search.ftl");
this.destroy = this.destroy.bind(this);
this._setupEventListeners();
let searchbar = this;

Просмотреть файл

@ -55,6 +55,8 @@ places-by-day-and-site =
places-history-search =
.placeholder = Search history
places-history =
.aria-label = History
places-bookmarks-search =
.placeholder = Search bookmarks

Просмотреть файл

@ -18,3 +18,13 @@ opensearch-error-download-desc =
{ -brand-short-name } could not download the search plugin from: { $location-url }
##
searchbar-submit =
.tooltiptext = Submit search
# This string is displayed in the search box when the input field is empty
searchbar-input =
.placeholder = Search
searchbar-icon =
.tooltiptext = Search

Просмотреть файл

@ -1,17 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- Toolbar items -->
<!ENTITY historyButton.label "History">
<!ENTITY newNavigatorCmd.label "New Window">
<!ENTITY newPrivateWindow.label "New Private Window">
<!ENTITY contentSearchSubmit.tooltip "Submit search">
<!-- LOCALIZATION NOTE (searchInput.placeholder):
This string is displayed in the search box when the input field is empty. -->
<!ENTITY searchInput.placeholder "Search">
<!ENTITY searchIcon.tooltip "Search">

Просмотреть файл

@ -21,7 +21,6 @@
locale/browser/accounts.properties (%chrome/browser/accounts.properties)
locale/browser/app-extension-fields.properties (%chrome/browser/app-extension-fields.properties)
locale/browser/browser.dtd (%chrome/browser/browser.dtd)
locale/browser/browser.properties (%chrome/browser/browser.properties)
locale/browser/customizableui/customizableWidgets.properties (%chrome/browser/customizableui/customizableWidgets.properties)
locale/browser/uiDensity.properties (%chrome/browser/uiDensity.properties)

Просмотреть файл

@ -84,7 +84,7 @@ toolbox.previousTool.key=CmdOrCtrl+[
# LOCALIZATION NOTE (toolbox.zoom*.key)
# Key shortcuts used to zomm in/out or reset the toolbox
# Should match fullZoom*Cmd.commandkey values from browser.dtd
# Should match full-zoom-*-shortcut values from browserSets.ftl
toolbox.zoomIn.key=CmdOrCtrl+Plus
toolbox.zoomIn2.key=CmdOrCtrl+=

Просмотреть файл

@ -0,0 +1,42 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from __future__ import absolute_import
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import transforms_from, VARIABLE_REFERENCE
from fluent.migrate import REPLACE, COPY
def migrate(ctx):
"""Bug 1730953 - Migrate strings from browser.dtd to Fluent, part {index}"""
ctx.add_transforms(
"browser/browser/places.ftl",
"browser/browser/places.ftl",
transforms_from(
"""
places-history =
.aria-label = { COPY(from_path, "historyButton.label") }
""",
from_path="browser/chrome/browser/browser.dtd",
),
)
ctx.add_transforms(
"browser/browser/search.ftl",
"browser/browser/search.ftl",
transforms_from(
"""
searchbar-submit =
.tooltiptext = { COPY(from_path, "contentSearchSubmit.tooltip") }
searchbar-input =
.placeholder = { COPY(from_path, "searchInput.placeholder") }
searchbar-icon =
.tooltiptext = { COPY(from_path, "searchIcon.tooltip") }
""",
from_path="browser/chrome/browser/browser.dtd",
),
)

Просмотреть файл

@ -41,8 +41,6 @@ function _test_makeURI() {
Assert.equal(CommonUtils.makeURI(uric1).spec, uric1);
let uric2 = "chrome://browser/skin/browser.css";
Assert.equal(CommonUtils.makeURI(uric2).spec, uric2);
let uric3 = "chrome://browser/locale/browser.dtd";
Assert.equal(CommonUtils.makeURI(uric3).spec, uric3);
_("Check about uris");
let uria1 = "about:weave";