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

vuex-i18n

Package Overview
Dependencies
Maintainers
3
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuex-i18n - npm Package Compare versions

Comparing version 1.13.0 to 1.13.1

104

dist/vuex-i18n.d.ts

@@ -1,4 +0,102 @@

declare module 'vuex-i18n' {
var plugin: any;
var store: any;
import _Vue, { PluginObject } from "vue";
declare module "vue/types/vue" {
interface Vue {
$i18n: Ii18n;
$t(key: string, options?: any, pluralization?: number): string | undefined;
$t(key: string, defaultValue: string, options?: any, pluralization?: number): string | undefined;
}
interface VueConstructor<V extends Vue = Vue> {
i18n: Ii18n;
}
}
export interface i18nState {
fallback: string | null;
locale: string | null;
translations: {
[key: string]: Translations;
};
}
export interface Translations {
[key: string]: string | Translations;
}
export interface Ii18n {
/** get the current locale */
locale(): string | null;
/** get all the registered locales */
locales(): string[];
/** set the current locale (i.e. 'de', 'en') */
set(locale: string): void;
/**
* add locale translation to the storage. this will extend existing information
* (i.e. 'de', {'message': 'Eine Nachricht'})
*/
add(locale: string, translations: Translations): void;
/**
* replace locale translations in the storage. this will remove all previous
* locale information for the specified locale
*/
replace(locale: string, translations: Translations): void;
/**
* remove the given locale from the store
*/
remove(locale: string): void;
/**
* set a fallback locale if translation for current locale does not exist
*/
fallback(locale: string): void;
/**
* get localized string from store. note that we pass the arguments passed
* to the function directly to the translateInLanguage function
*/
translate(key: string, options?: any, pluralization?: number): string | undefined;
/**
* get localized string from store. note that we pass the arguments passed
* to the function directly to the translateInLanguage function
*/
translate(key: string, defaultValue: string, options?: any, pluralization?: number): string | undefined;
/**
* get localized string from store in a given language if available.
*/
translateIn(locale: string, key: string, options?: any, pluralization?: number): string | undefined;
/**
* get localized string from store in a given language if available.
*/
translateIn(locale: string, key: string, defaultValue: string, options?: any, pluralization?: number): string | undefined;
/**
* check if the given locale translations are present in the store
*/
localeExists(locale: string): boolean;
/**
* check if the given key is available
* optional with a second parameter to limit the scope
* strict: only current locale (exact match)
* locale: current locale and parent language locale (i.e. en-us & en)
* fallback: current locale, parent language locale and fallback locale
* the default is fallback
*/
keyExists(key: string, scope?: string): boolean;
}
declare const _default: {
plugin: PluginObject<Ii18n>;
store: Object; // the store can be of any form of object
};
export default _default;

2

package.json
{
"name": "vuex-i18n",
"version": "1.13.0",
"version": "1.13.1",
"description": "Easy localization for vue-components using vuex as data store",

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

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