This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import node from '@astrojs/node' | |
import { defineConfig } from 'astro/config' | |
// https://astro.build/config | |
export default defineConfig({ | |
adapter: node({ | |
mode: 'middleware', | |
}), | |
trailingSlash: 'never', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable */ | |
import { default as ICUConvert } from './icu' | |
import { isPlainObject, pickBy, set, transform } from 'lodash' | |
import * as pluralCategories from 'make-plural/pluralCategories' | |
import { readdir } from 'node:fs/promises' | |
const cldrPluralCategories = ['zero', 'one', 'two', 'few', 'many', 'other'] | |
const cldrReversed = cldrPluralCategories.reverse() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Removes files from public/static/locales/<lang>/ that have no matching | |
// file in public/static/locales/en/ | |
import { readdir, unlink } from 'node:fs/promises' | |
import { basename, join } from 'node:path' | |
const TRANSLATIONS_ROOT_DIR = 'public/static/locales/' | |
/** | |
* @param {string | Buffer | URL} directoryPath |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { default as ICUConvert } from '@messageformat/convert' | |
import * as pluralCategories from 'make-plural/pluralCategories' | |
import { readdir } from 'node:fs/promises' | |
import { transform, set, isPlainObject, pickBy } from 'lodash' | |
const cldrPluralCategories = ['zero', 'one', 'two', 'few', 'many', 'other'] | |
/** | |
* Get country from locale (pt_BR -> pt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put it somewhere in your theme's functions.php | |
add_action('threewp_broadcast_get_user_writable_blogs', function( $action ) { | |
if ( $action->is_finished() ) | |
return; | |
$blogs = is_super_admin() ? wp_get_sites() : get_blogs_of_user( $action->user_id ); | |
foreach( $blogs as $blog) | |
{ | |
$blog = \threewp_broadcast\broadcast_data\blog::make( $blog ); |