Rebuild icu-types as a part of dev:transpile
Co-authored-by: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com>
This commit is contained in:
parent
0bfb3ac778
commit
698cd59693
5 changed files with 108 additions and 5 deletions
4
ts/scripts/constants.ts
Normal file
4
ts/scripts/constants.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export const DELETED_REGEXP = /\(\s*deleted\s+(\d{2,4}\/\d{2}\/\d{2,4})\s*\)/i;
|
|
@ -11,7 +11,7 @@ import type { ICUMessageParamType } from '../util/getICUMessageParams';
|
|||
import { missingCaseError } from '../util/missingCaseError';
|
||||
import globalMessages from '../../_locales/en/messages.json';
|
||||
|
||||
import { DELETED_REGEXP } from './remove-strings';
|
||||
import { DELETED_REGEXP } from './constants';
|
||||
|
||||
function translateParamType(
|
||||
param: ICUMessageParamType,
|
||||
|
|
|
@ -9,14 +9,13 @@ import path from 'path';
|
|||
|
||||
import { MONTH } from '../util/durations';
|
||||
import { isOlderThan } from '../util/timestamp';
|
||||
import { DELETED_REGEXP } from './constants';
|
||||
|
||||
const ROOT_DIR = path.join(__dirname, '..', '..');
|
||||
const MESSAGES_FILE = path.join(ROOT_DIR, '_locales', 'en', 'messages.json');
|
||||
|
||||
const limitter = pLimit(10);
|
||||
|
||||
export const DELETED_REGEXP = /\(\s*deleted\s+(\d{2,4}\/\d{2}\/\d{2,4})\s*\)/i;
|
||||
|
||||
async function main() {
|
||||
const messages = JSON.parse(await fs.readFile(MESSAGES_FILE, 'utf-8'));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue