Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: remove translated messages when ICU arguments change #9598

Merged
merged 3 commits into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lighthouse-core/lib/i18n/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function lookupLocale(locale) {
function _preformatValues(icuMessage, messageFormatter, values = {}) {
const clonedValues = JSON.parse(JSON.stringify(values));

const elements = _collectAllCustomElementsFromICU(messageFormatter.getAst().elements);
const elements = collectAllCustomElementsFromICU(messageFormatter.getAst().elements);

return _processParsedElements(icuMessage, Array.from(elements.values()), clonedValues);
}
Expand All @@ -165,10 +165,10 @@ function _preformatValues(icuMessage, messageFormatter, values = {}) {
* thus they are stored via a Map keyed on the "id" which is the ICU varName.
*
* @param {Array<MessageElement>} icuElements
* @param {Map<string, ArgumentElement>} seenElementsById
* @param {Map<string, ArgumentElement>} [seenElementsById]
* @return {Map<string, ArgumentElement>}
*/
function _collectAllCustomElementsFromICU(icuElements, seenElementsById = new Map()) {
function collectAllCustomElementsFromICU(icuElements, seenElementsById = new Map()) {
for (const el of icuElements) {
// We are only interested in elements that need ICU formatting (argumentElements)
if (el.type !== 'argumentElement') continue;
Expand All @@ -180,7 +180,7 @@ function _collectAllCustomElementsFromICU(icuElements, seenElementsById = new Ma
// Look at all options of the plural (=1{} =other{}...)
for (const option of el.format.options) {
// Run collections on each option's elements
_collectAllCustomElementsFromICU(option.value.elements, seenElementsById);
collectAllCustomElementsFromICU(option.value.elements, seenElementsById);
}
}

Expand Down Expand Up @@ -473,4 +473,5 @@ module.exports = {
getFormattedFromIdAndValues,
replaceIcuMessageInstanceIds,
isIcuMessage,
collectAllCustomElementsFromICU,
};
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/ar-XB.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "‏‮Tap‬‏ ‏‮targets‬‏ ‏‮are‬‏ ‏‮sized‬‏ ‏‮appropriately‬‏"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "‏‮Main‬‏ ‏‮Thread‬‏ ‏‮Time‬‏"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "‏‮Third‬‏-‏‮Party‬‏"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "‏‮Third‬‏-‏‮party‬‏ ‏‮code‬‏ ‏‮can‬‏ ‏‮significantly‬‏ ‏‮impact‬‏ ‏‮load‬‏ ‏‮performance‬‏. ‏‮Limit‬‏ ‏‮the‬‏ ‏‮number‬‏ ‏‮of‬‏ ‏‮redundant‬‏ ‏‮third‬‏-‏‮party‬‏ ‏‮providers‬‏ ‏‮and‬‏ ‏‮try‬‏ ‏‮to‬‏ ‏‮load‬‏ ‏‮third‬‏-‏‮party‬‏ ‏‮code‬‏ ‏‮after‬‏ ‏‮your‬‏ ‏‮page‬‏ ‏‮has‬‏ ‏‮primarily‬‏ ‏‮finished‬‏ ‏‮loading‬‏. [‏‮Learn‬‏ ‏‮more‬‏](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)."
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{1 ‏‮Third‬‏-‏‮Party‬‏ ‏‮Found‬‏}zero{# ‏‮Third‬‏-‏‮Parties‬‏ ‏‮Found‬‏}two{# ‏‮Third‬‏-‏‮Parties‬‏ ‏‮Found‬‏}few{# ‏‮Third‬‏-‏‮Parties‬‏ ‏‮Found‬‏}many{# ‏‮Third‬‏-‏‮Parties‬‏ ‏‮Found‬‏}other{# ‏‮Third‬‏-‏‮Parties‬‏ ‏‮Found‬‏}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "‏‮Third‬‏-‏‮Party‬‏ ‏‮Usage‬‏"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "يتم تحديد حجم أهداف النقر بشكل مناسب"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "وقت سلسلة المحادثات الأساسية"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "الجهة الخارجية"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "يمكن أن يؤثر رمز الجهة الخارجية بشكل كبير في أداء التحميل. يمكنك تحديد عدد مقدِّمي الخدمة للجهات الخارجية المتكرّرين ومحاولة تحميل رمز الجهة الخارجية بعد انتهاء تحميل صفحتك بشكل أساسي. [مزيد من المعلومات](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)"
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{تم العثور على جهة خارجية واحدة}zero{تم العثور على # جهة خارجية}two{تم العثور على جهتين خارجيتين (#)}few{تم العثور على # جهات خارجية}many{تم العثور على # جهة خارجية}other{تم العثور على # جهة خارجية}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "استخدام الجهات الخارجية"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "Целевите зони за докосване са оразмерени правилно"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "Време на основната нишка"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "Трета страна"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "Кодът от трети страни може сериозно да повлияе върху скоростта на зареждане. Ограничете броя на излишните доставчици трети страни и опитайте да зареждате кода от трети страни, след като основното зареждане на страницата ви е приключило. [Научете повече](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)."
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{Открит е 1 фрагмент с код от трета страна}other{Открити са # фрагмента с код от трета страна}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "Използване на код от трети страни"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "La mida dels elements tàctils és correcta"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "Durada del fil principal"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "Tercers"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "El codi de tercers pot afectar significativament el rendiment de la càrrega. Limita el nombre de proveïdors externs redundants i prova de carregar codi de tercers quan la càrrega principal de la pàgina ha finalitzat. [Obtén més informació](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)."
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{S'ha trobat 1 tercer}other{S'han trobat # tercers}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "Ús de tercers"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "Dotykové prvky jsou dostatečně velké"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "Doba hlavního podprocesu"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "Třetí strana"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "Kód třetích stran může mít významný dopad na rychlost načítání. Omezte počet redundantních externích poskytovatelů a snažte se kód třetích stran načítat až poté, co se dokončí načtení vaší stránky. [Další informace](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)"
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{Byla nalezena 1 třetí strana}few{Byly nalezeny # třetí strany}many{Bylo nalezeno # třetí strany}other{Bylo nalezeno # třetích stran}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "Použití zdrojů od třetích stran"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "Trykbare elementer har en passende størrelse"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "Tid for primær tråd"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "Tredjepart"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "Kode fra tredjeparter kan have en væsentlig indvirkning på indlæsningen. Begræns antallet af overflødige tredjepartsudbydere, og prøv at indlæse kode fra tredjeparter, når indlæsningen af siden næsten er færdig. [Få flere oplysninger](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)."
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{1 tredjepart blev fundet}one{# tredjepart blev fundet}other{# tredjeparter blev fundet}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "Tredjepartsbrug"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "Größe von Tippzielen ist richtig eingestellt"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "Dauer des Hauptthreads"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "Drittanbieter"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "Code von Drittanbietern kann die Ladegeschwindigkeit erheblich beeinträchtigen. Beschränken Sie die Zahl redundanter Drittanbieter und versuchen Sie, solchen Code erst nachträglich zu laden. [Weitere Informationen.](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)"
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{1 Drittanbieter gefunden}other{# Drittanbieter gefunden}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "Nutzung von Drittanbieter-Code"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "Τα στοιχεία που επιλέγονται με πάτημα έχουν το κατάλληλο μέγεθος"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "Χρόνος κύριου νήματος"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "Τρίτο μέρος"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "Ο κώδικας τρίτων παρόχων μπορεί να επηρεάσει σημαντικά την απόδοση φόρτωσης. Περιορίστε τον αριθμό των περιττών τρίτων παρόχων και προσπαθήστε η φόρτωση του κώδικα τρίτων παρόχων να γίνεται αφού πρώτα έχει ολοκληρωθεί η φόρτωση της σελίδας σας. [Μάθετε περισσότερα](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)."
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{Βρέθηκε 1 τρίτο μέρος}other{Βρέθηκαν # τρίτα μέρη}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "Χρήση κώδικα τρίτου"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "Tap targets are sized appropriately"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "Main thread time"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "Third-party"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "Third-party code can significantly impact load performance. Limit the number of redundant third-party providers and try to load third-party code after your page has primarily finished loading. [Learn more](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)."
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{1 third-party found}other{# third-parties found}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "Third-party usage"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/en-XA.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "[Ţåþ ţåŕĝéţš åŕé šîžéð åþþŕöþŕîåţéļý one two three four five six seven eight]"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "[Måîñ Ţĥŕéåð Ţîmé one two]"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "[Ţĥîŕð-Þåŕţý one two]"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "[Ţĥîŕð-þåŕţý çöðé çåñ šîĝñîƒîçåñţļý îmþåçţ ļöåð þéŕƒöŕmåñçé. Ļîmîţ ţĥé ñûmбéŕ öƒ ŕéðûñðåñţ ţĥîŕð-þåŕţý þŕövîðéŕš åñð ţŕý ţö ļöåð ţĥîŕð-þåŕţý çöðé åƒţéŕ ýöûŕ þåĝé ĥåš þŕîmåŕîļý ƒîñîšĥéð ļöåðîñĝ. ᐅ[ᐊĻéåŕñ möŕéᐅ](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)ᐊ. one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty twentyone twentytwo twentythree twentyfour twentyfive twentysix twentyseven twentyeight]"
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{[1 Ţĥîŕð-Þåŕţý Föûñð one two three]}other{[# Ţĥîŕð-Þåŕţîéš Föûñð one two three]}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "[Ţĥîŕð-Þåŕţý Ûšåĝé one two three]"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/es-419.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "El tamaño de los elementos táctiles es el adecuado"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "Tiempo del subproceso principal"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "Terceros"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "El código de terceros puede reducir en gran medida el rendimiento de carga. Limita la cantidad de proveedores externos redundantes y prueba cargar el código de terceros después de que haya finalizado la carga principal de tu página. [Obtén más información](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)."
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{Se encontró 1 código de terceros}other{Se encontraron # códigos de terceros}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "Uso por parte de terceros"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "El tamaño de los elementos táctiles es el adecuado"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "Tiempo del hilo principal"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "Proveedor externo"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "El código externo puede afectar mucho a la velocidad de carga. Limita el número de proveedores externos redundantes e intenta cargar el código externo cuando se haya completado la carga principal de tu página. [Más información](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)"
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{Se ha encontrado 1 entidad de terceros}other{Se han encontrado # entidades de terceros}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "Uso de código externo"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "Napautuskohteet ovat sopivan kokoisia"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "Pääsäikeen aika"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "Kolmas osapuoli"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "Kolmannen osapuolen koodi voi vaikuttaa lataustehokkuuteen merkittävästi. Rajoita tarpeettomien kolmannen osapuolen palveluntarjoajien määrää ja yritä ladata kolmannen osapuolen koodi sen jälkeen, kun sivun ensisijainen lataus on valmis. [Lue lisää](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)."
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{1 kolmas osapuoli löytyi}other{# kolmatta osapuolta löytyi}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "Kolmannen osapuolen käyttö"
},
Expand Down
6 changes: 0 additions & 6 deletions lighthouse-core/lib/i18n/locales/fil.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,18 +971,12 @@
"lighthouse-core/audits/seo/tap-targets.js | title": {
"message": "Angkop ang laki ng mga target ng pag-tap"
},
"lighthouse-core/audits/third-party-summary.js | columnMainThreadTime": {
"message": "Oras sa Main Thread"
},
"lighthouse-core/audits/third-party-summary.js | columnThirdParty": {
"message": "Third-Party"
},
"lighthouse-core/audits/third-party-summary.js | description": {
"message": "Puwedeng lubos na makaapekto ang code ng third party sa performance ng pag-load. Limitahan ang bilang ng paulit-ulit na mga third-party na provider at subukang i-load ang code ng third party pagkatapos ng pangunahing pag-load ng iyong page. [Matuto pa](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/)."
},
"lighthouse-core/audits/third-party-summary.js | displayValue": {
"message": "{itemCount,plural, =1{1 Third Party ang Nakita}one{# Third Party ang Nakita}other{# na Third Party ang Nakita}}"
},
"lighthouse-core/audits/third-party-summary.js | title": {
"message": "Paggamit ng Third Party"
},
Expand Down
Loading