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

described-i18n-loader

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

described-i18n-loader

Load i18n json files with key value pairs while stripping the 'desc' key from all subkeys. eg: key = 'conf.title', value = { text: "Configuration", desc: "Title for config screen" }

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

described-18n-loader

A webpack 1 & 2 loader for i18n json bundles that look like this:

{
	"conf": {
		"title": {
			"desc": "Title for config screen",
			"text": "Configuration"
		}
	},

	"app": {
		"title": {
			"desc": "The app window title",
			"text": "MyApp"
		}
	},

	"nav": {
		"button": {
			"home": {
				"desc": "Navbar button for the app's homescreen",
				"text": "Home"
			},
			"about": {
				"desc": "Navbar button for the app's about screen",
				"text": "About"
			}
		}
	},

	"another": {
		"pure": {
			"key": "Pure key"
		}
	}
}

The loader will parse the json and replace the objects with their text property value or leave the string like in another.pure.key.

The output looks like this (just minified):

(node)

module.exports = {
	"conf.title": "Configuration",
	"app.title": "MyApp",
	"nav.button.home": "Home",
	"nav.button.about": "About",
	"another.pure.key": "Pure Key"
};

(es6)

export default {
	"conf.title": "Configuration",
	"app.title": "MyApp",
	"nav.button.home": "Home",
	"nav.button.about": "About",
	"another.pure.key": "Pure Key"
}

Options

  • forceModuleExports: force node style module DEFAULT - webpack 1: true, webpack 2: false

FAQs

Package last updated on 02 Apr 2017

Did you know?

Socket

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.

Install

Related posts

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