diff --git a/notNeededPackages.json b/notNeededPackages.json index 0b59f8d690..6addfe96ec 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -4692,6 +4692,12 @@ "sourceRepoURL": "https://github.com/rigor789/vue-scrollto", "asOfVersion": "2.17.1" }, + { + "libraryName": "vuex-i18n", + "typingsPackageName": "vuex-i18n", + "sourceRepoURL": "https://github.com/dkfbasel/vuex-i18n", + "asOfVersion": "1.13.0" + }, { "libraryName": "typescript", "typingsPackageName": "w3c-permissions", diff --git a/types/vuex-i18n/index.d.ts b/types/vuex-i18n/index.d.ts deleted file mode 100644 index 6db628a849..0000000000 --- a/types/vuex-i18n/index.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -// Type definitions for vuex-i18n 1.10 -// Project: https://github.com/dkfbasel/vuex-i18n -// Definitions by: Cedric Kemp -// Noam Kfir -// Suleimanov Artem -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.9 - -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 { - 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; -}; - -export default _default; diff --git a/types/vuex-i18n/package.json b/types/vuex-i18n/package.json deleted file mode 100644 index f180048358..0000000000 --- a/types/vuex-i18n/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "private": true, - "dependencies": { - "vue": ">=2.0.0", - "vuex": ">=2.0.0" - } -} diff --git a/types/vuex-i18n/tsconfig.json b/types/vuex-i18n/tsconfig.json deleted file mode 100644 index 9f8f6eb2fd..0000000000 --- a/types/vuex-i18n/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es5", - "lib": [ - "es6", - "dom" - ], - "types": [], - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "noEmit": true, - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "vuex-i18n-tests.ts" - ] -} \ No newline at end of file diff --git a/types/vuex-i18n/tslint.json b/types/vuex-i18n/tslint.json deleted file mode 100644 index f93cf8562a..0000000000 --- a/types/vuex-i18n/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -} diff --git a/types/vuex-i18n/vuex-i18n-tests.ts b/types/vuex-i18n/vuex-i18n-tests.ts deleted file mode 100644 index 11010df30b..0000000000 --- a/types/vuex-i18n/vuex-i18n-tests.ts +++ /dev/null @@ -1,51 +0,0 @@ -// load vue and vuex instance -import Vue from "vue"; -import { Store } from "vuex"; - -// load vuex i18n module -import vuexI18n, { i18nState } from "vuex-i18n"; - -// declare interface for store's root state -interface RootState { - i18n: i18nState; -} - -// initialize the vuex store using the vuex module. note that you can change the -// name of the module if you wish -const store = new Store({}); - -// initialize the internationalization plugin on the vue instance. note that -// the store must be passed to the plugin. the plugin will then generate some -// helper functions for components (i.e. this.$i18n.set, this.$t) and on the vue -// instance (i.e. Vue.i18n.set). -Vue.use(vuexI18n.plugin, store); - -// please note that you must specify the name of the vuex module if it is -// different from i18n. i.e. Vue.use(vuexI18n.plugin, store, "myName") - -// add some translations (could also be loaded from a separate file) -// note that it is possible to use placeholders. translations can also be -// structured as object trees and will automatically be flattened by the the -// plugin -const translationsEn = { - content: "This is some {type} content", - tree: { - nested: "This is nested content" - } -}; - -// translations can be kept in separate files for each language -// i.e. resources/i18n/de.json. -const translationsDe = { - "My nice title": "Ein schöner Titel", - content: "Dies ist ein toller Inhalt" -}; - -// add translations directly to the application -Vue.i18n.add("en", translationsEn); -Vue.i18n.add("de", translationsDe); - -// set the start locale to use -Vue.i18n.set("en"); - -Vue.i18n.translateIn("en", "tree.nested");