localized-strings
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40790
1