Move locale-data back to `app/javascript/mastodon/locales/locale-data` (#2169)

This reduces differences with upstream and fixes a bunch of locale-data
files having been forgotten.
This commit is contained in:
Claire 2023-04-08 14:11:40 +02:00 committed by GitHub
parent dc6befe1a4
commit 10469a0b85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ const { existsSync, readdirSync, writeFileSync } = require('fs');
const { join, resolve } = require('path'); const { join, resolve } = require('path');
const rimraf = require('rimraf'); const rimraf = require('rimraf');
const mkdirp = require('mkdirp'); const mkdirp = require('mkdirp');
const { flavours } = require('./configuration.js'); const { flavours } = require('./configuration');
module.exports = Object.keys(flavours).reduce(function (map, entry) { module.exports = Object.keys(flavours).reduce(function (map, entry) {
const flavour = flavours[entry]; const flavour = flavours[entry];
@ -43,13 +43,13 @@ module.exports = Object.keys(flavours).reduce(function (map, entry) {
// first try react-intl // first try react-intl
`node_modules/react-intl/locale-data/${baseLocale}.js`, `node_modules/react-intl/locale-data/${baseLocale}.js`,
// then check locales/locale-data // then check locales/locale-data
`app/javascript/locales/locale-data/${baseLocale}.js`, `app/javascript/mastodon/locales/locale-data/${baseLocale}.js`,
// fall back to English (this is what react-intl does anyway) // fall back to English (this is what react-intl does anyway)
'node_modules/react-intl/locale-data/en.js', 'node_modules/react-intl/locale-data/en.js',
].filter( ].filter(
filename => existsSync(filename) filename => existsSync(filename),
).map( ).map(
filename => filename.replace(/(?:node_modules|app\/javascript)\//, '') filename => filename.replace(/(?:node_modules|app\/javascript)\//, ''),
)[0]; )[0];
const localeContent = `// const localeContent = `//
// locales/${entry}/${locale}.js // locales/${entry}/${locale}.js