Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

next-multilingual

Package Overview
Dependencies
Maintainers
1
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-multilingual - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

4

lib/config/index.d.ts

@@ -60,3 +60,3 @@ import type { Rewrite, Redirect } from 'next/dist/lib/load-custom-routes';

*
* @param applicationIdentifier - The unique application identifier that will be used as a messages key prefix. Must be between 3 to 50 alphanumerical characters.
* @param applicationIdentifier - The unique application identifier that will be used as a messages key prefix.
* @param locales - The actual desired locales of the multilingual application. The first locale will be the default locale. Only BCP 47 language tags following the `language`-`country` format are accepted.

@@ -159,3 +159,3 @@ * @param pagesDirectoryPath - Specify where your `pages` directory is, when not using the Next.js default location.

*
* @param applicationIdentifier - The unique application identifier that will be used as a messages key prefix. Must be between 3 to 50 alphanumerical characters.
* @param applicationIdentifier - The unique application identifier that will be used as a messages key prefix.
* @param locales - The actual desired locales of the multilingual application. The first locale will be the default locale. Only BCP 47 language tags following the `language`-`country` format are accepted.

@@ -162,0 +162,0 @@ * @param options - Next.js configuration options.

@@ -72,3 +72,3 @@ "use strict";

*
* @param applicationIdentifier - The unique application identifier that will be used as a messages key prefix. Must be between 3 to 50 alphanumerical characters.
* @param applicationIdentifier - The unique application identifier that will be used as a messages key prefix.
* @param locales - The actual desired locales of the multilingual application. The first locale will be the default locale. Only BCP 47 language tags following the `language`-`country` format are accepted.

@@ -85,3 +85,3 @@ * @param pagesDirectoryPath - Specify where your `pages` directory is, when not using the Next.js default location.

if (!messages_1.keySegmentRegExp.test(applicationIdentifier)) {
throw new Error(`invalid application identifier '${applicationIdentifier}'. Application identifiers must be between 3 and 50 alphanumerical character.`);
throw new Error(`invalid application identifier '${applicationIdentifier}'. Application identifiers ${messages_1.keySegmentRegExpDescription}.`);
}

@@ -395,3 +395,3 @@ // Add `applicationIdentifier` to environment variables so that it is available at build time, without extra config.

*
* @param applicationIdentifier - The unique application identifier that will be used as a messages key prefix. Must be between 3 to 50 alphanumerical characters.
* @param applicationIdentifier - The unique application identifier that will be used as a messages key prefix.
* @param locales - The actual desired locales of the multilingual application. The first locale will be the default locale. Only BCP 47 language tags following the `language`-`country` format are accepted.

@@ -398,0 +398,0 @@ * @param options - Next.js configuration options.

@@ -89,3 +89,3 @@ "use strict";

if (!_1.keySegmentRegExp.test(contextSegment)) {
__1.log.warn(`unable to use messages in \`${propertiesFilePath}\` because the context \`${contextSegment}\` in key \`${key}\` is invalid. Key context must be between 3 and 50 alphanumerical character.`);
__1.log.warn(`unable to use messages in \`${propertiesFilePath}\` because the context \`${contextSegment}\` in key \`${key}\` is invalid. Key context ${_1.keySegmentRegExpDescription}.`);
return {};

@@ -101,3 +101,3 @@ }

if (!_1.keySegmentRegExp.test(idSegment)) {
__1.log.warn(`unable to use messages in \`${propertiesFilePath}\` because the identifier \`${idSegment}\` in key \`${key}\` is invalid. Key identifiers must be between 3 and 50 alphanumerical character.`);
__1.log.warn(`unable to use messages in \`${propertiesFilePath}\` because the identifier \`${idSegment}\` in key \`${key}\` is invalid. Key identifiers ${_1.keySegmentRegExpDescription}.`);
return {};

@@ -104,0 +104,0 @@ }

import { KeyValueObject } from './properties';
/** This is the regular expression to validate message key segments. */
export declare const keySegmentRegExp: RegExp;
/** This is the regular expression description to keep logs consistent. */
export declare const keySegmentRegExpDescription = "must be between 1 and 50 alphanumerical characters";
/**

@@ -5,0 +7,0 @@ * Get a page's title from the locale scope messages.

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.useMessages = exports.Messages = exports.Message = exports.getSourceFilePath = exports.getMessagesFilePath = exports.getTitle = exports.keySegmentRegExp = void 0;
exports.useMessages = exports.Messages = exports.Message = exports.getSourceFilePath = exports.getMessagesFilePath = exports.getTitle = exports.keySegmentRegExpDescription = exports.keySegmentRegExp = void 0;
const router_1 = require("next/router");

@@ -14,3 +14,5 @@ const path_1 = require("path");

/** This is the regular expression to validate message key segments. */
exports.keySegmentRegExp = /^[a-z\d]{3,50}$/i;
exports.keySegmentRegExp = /^[a-z\d]{1,50}$/i;
/** This is the regular expression description to keep logs consistent. */
exports.keySegmentRegExpDescription = 'must be between 1 and 50 alphanumerical characters';
/**

@@ -17,0 +19,0 @@ * Get a page's title from the locale scope messages.

{
"name": "next-multilingual",
"description": "An opinionated end-to-end multilingual solution for Next.js.",
"version": "0.4.0",
"version": "0.4.1",
"license": "MIT",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc