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

language-manager

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

language-manager - npm Package Compare versions

Comparing version 0.0.7 to 0.0.9

2

package.json
{
"name": "language-manager",
"version": "0.0.7",
"version": "0.0.9",
"description": "The most flexible version of multi-language management. Manages language resources. Makes it easy to switch between different language sources.",

@@ -5,0 +5,0 @@ "author": "azmisahin@outlook.com",

@@ -10,3 +10,59 @@ # language-manager

```
# Add Resource
Place the file containing the source language definitions in a folder. For example, "tests/resource".
```shell
example.com/ # → Root folder for the project
└── tests/ # → Tests folder
└── resource/ # → Resource Folder .setPath('tests/resource')
└── json/ # → Resource Type Folder .setType(LanguageManager.ResourceType.Json)
├── en-us.json # → Resource language.extention English United States
└── tr-tr.json # → Resource language.extention Turkish Turkey
```
## Sample Resource File
en-us.json
```json
{
"root": {
"data": [
{
"type": "string",
"name": "app.name",
"value": "Language Manager"
},
{
"type": "string",
"name": "words.ok",
"value": "Okay"
}
]
}
}
```
tr-tr.json
```json
{
"root": {
"data": [
{
"type": "string",
"name": "app.name",
"value": "Dil Yöneticisi"
},
{
"type": "string",
"name": "words.ok",
"value": "Tamam"
}
]
}
}
```
# Usage

@@ -13,0 +69,0 @@

@@ -55,5 +55,14 @@ /**

/// Default require
var result= require('../../' + this.File)
/// Require path module
var path = require('path')
/// Root application
this.BaseDir = process.cwd()
/// Resource Path
this.ResourcePath = path.join(this.BaseDir, this.File)
/// Require
var result = require(this.ResourcePath)
/// Only string result

@@ -60,0 +69,0 @@ result = JSON.stringify(result)

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