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.0.6 to 0.0.7

38

lib/LocalizedStrings.d.ts

@@ -12,8 +12,44 @@ declare module 'localized-strings' {

export interface LocalizedStringsMethods {
/**
* Can be used from ouside the class to force a particular language
* indipendently from the interface one
* @param language
*/
setLanguage(language: string): void;
/**
* The current language displayed (could differ from the interface language
* if it has been forced manually and a matching translation has been found)
*/
getLanguage(): string;
/**
* The current interface language (could differ from the language displayed)
*/
getInterfaceLanguage(): string;
/**
* Format the passed string replacing the numbered placeholders
* i.e. I'd like some {0} and {1}, or just {0}
* Use example:
* strings.formatString(strings.question, strings.bread, strings.butter)
*/
formatString<T extends Formatted>(str: string, ...values: Array<T | FormatObject<T>>): Array<string | T>;
/**
* Return an array containing the available languages passed as props in the constructor
*/
getAvailableLanguages(): string[];
/**
* Return a string with the passed key in a different language
* @param key
* @param language
*/
getString(key: string, language: string): string;
/**
* Replace the NamedLocalization object without reinstantiating the object
* @param props
*/
setContent(props: any): void;

@@ -29,4 +65,4 @@ }

var LocalizedStrings: LocalizedStringsFactory;
const LocalizedStrings: LocalizedStringsFactory;
export default LocalizedStrings;
}

2

package.json
{
"name": "localized-strings",
"version": "0.0.6",
"version": "0.0.7",
"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": {

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