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

localized-strings

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localized-strings - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

.DS_Store

2

package.json
{
"name": "localized-strings",
"version": "0.2.1",
"version": "0.2.2",
"description": "Simple module to localize the strings of any JS based program using the same syntax used in the ReactLocalization and ReactNativeLocalization module, use 'npm run build' before publishing",

@@ -5,0 +5,0 @@ "scripts": {

@@ -59,6 +59,6 @@ # localized-strings

// or
console.log("HOW:" + strings.getValue("how"));
console.log("HOW:" + strings.getString("how"));
```
If value is missing getValue will not throw an error and break (e.g. using React)
If value is missing getString will not throw an error and break (e.g. using React)

@@ -69,3 +69,3 @@ ```js

// returns null
console.log("Missing:" + strings.getValue("fridge.cabinet.toast"));
console.log("Missing:" + strings.getString("fridge.cabinet.toast"));
```

@@ -208,3 +208,3 @@

- getInterfaceLanguage() - to get the current device interface language (from Navigation.language in browsers, BCP-47, https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language)
- getValue(path) - get value from string path, returns error instead of throws exception as with . notation
- getString(path) - get value from string path, returns error instead of throws exception as with . notation
- formatString() - to format the passed string replacing its placeholders {n} with the other arguments strings. Can also be used with $ref{id} to reference another string

@@ -211,0 +211,0 @@

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