2.1.0 • Published 7 years ago

described-i18n-loader v2.1.0

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

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
2.1.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago