chore: update to standard 12

This commit is contained in:
Samuel Attard 2018-09-14 02:10:51 +10:00
parent 9e85bdb02c
commit 558fff69e7
No known key found for this signature in database
GPG key ID: E89DDE5742D58C4E
198 changed files with 4455 additions and 2940 deletions

View file

@ -4,7 +4,7 @@
// Does not implement predefined messages:
// https://developer.chrome.com/extensions/i18n#overview-predefined
const {ipcRenderer} = require('electron')
const { ipcRenderer } = require('electron')
const fs = require('fs')
const path = require('path')
@ -60,7 +60,7 @@ const replacePlaceholders = (message, placeholders, substitutions) => {
if (placeholders) {
Object.keys(placeholders).forEach((name) => {
let {content} = placeholders[name]
let { content } = placeholders[name]
content = replaceNumberedSubstitutions(content, substitutions)
message = message.replace(new RegExp(`\\$${name}\\$`, 'gi'), content)
})
@ -72,7 +72,7 @@ const replacePlaceholders = (message, placeholders, substitutions) => {
const getMessage = (extensionId, messageName, substitutions) => {
const messages = getMessages(extensionId, getLanguage())
if (messages.hasOwnProperty(messageName)) {
const {message, placeholders} = messages[messageName]
const { message, placeholders } = messages[messageName]
return replacePlaceholders(message, placeholders, substitutions)
}
}