
Security News
Security Community Slams MIT-linked Report Claiming AI Powers 80% of Ransomware
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.
@gasket/intl
Advanced tools
Provides internationalization managers for translation files and locale handling.
npm i @gasket/intl @gasket/plugin-intl
See @gasket/plugin-intl for more information on how to configure the plugin.
With a intl.js built by @gasket/plugin-intl, you can use the IntlManager to
get messages for locales.
import intlManager from '../path/to/intl.js';
// Get a locale handler for a specific locale
const localeHandler = intlManager.handleLocale('en-US');
// Get all loaded messages for the locale
const messages = localeHandler.getAllMessages();
The IntlManager can also be used to resolve locale based on the supported locales that have been configured for @gasket/plugin-intl.
import intlManager from '../path/to/intl.js';
// Resolve a locale to a supported locale
const resolvedLocale = intlManager.resolveLocale('fr-CA');
// If fr-CA is not supported but fr is, resolvedLocale will be 'fr'
// If neither is supported, it will fall back to the default locale
To list all supported locales, you can use:
import intlManager from '../path/to/intl.js';
// Get all supported locales
const supportedLocales = intlManager.locales;
While the above examples cover the most common use cases, the @gasket/intl package also provides advanced features for
managing locale files and their loading status. These are useful for scenarios where the React components from
@gasket/react-intl are not available or when you need to manage locale files directly.
import intlManager from '../path/to/intl.js';
const localeHandler = intlManager.handleLocale('en-US');
// Load multiple locale files
await localeHandler.load(
  'locales/common',
  'locales/homepage',
  'locales/user-profile'
);
// Get all loaded messages
const messages = localeHandler.getAllMessages();
import intlManager from '../path/to/intl.js';
import { LocaleFileStatus } from '@gasket/intl';
const localeHandler = intlManager.handleLocale('en-US');
// Start loading a locale file
localeHandler.load('locales/common');
// Check the status
const status = localeHandler.getStatus('locales/common');
if (status === LocaleFileStatus.loading) {
  console.log('Locale file is still loading...');
} else if (status === LocaleFileStatus.loaded) {
  console.log('Locale file has been loaded successfully!');
} else if (status === LocaleFileStatus.error) {
  console.error('Failed to load locale file');
}
The staticLocaleFilePaths configuration in @gasket/plugin-intl allows you to specify which locale files should be
preloaded for server-side rendering (SSR) and available immediately when the app starts.
Configure staticLocaleFilePaths in your gasket.js:
// gasket.js
export default makeGasket({
  intl: {
    locales: ['en-US', 'fr-FR'],
    staticLocaleFilePaths: [
      'locales/common',
      'locales/navigation', 
      'locales/errors'
    ]
  }
});
import intlManager from '../path/to/intl.js';
const localeHandler = intlManager.handleLocale('en-US');
// Load all configured static locale files
await localeHandler.loadStatics();
// Or load specific static files
await localeHandler.loadStatics('locales/common', 'locales/navigation');
// Get the static messages register for SSR
const staticsRegister = localeHandler.getStaticsRegister();
// Pass this to the client for hydration
FAQs
Internationalization managers for translation files and locale handling.
The npm package @gasket/intl receives a total of 1,467 weekly downloads. As such, @gasket/intl popularity was classified as popular.
We found that @gasket/intl demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.