5.15.148 • Published 12 months ago

@firanorg/voluptatibus-soluta-dignissimos v5.15.148

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@firanorg/voluptatibus-soluta-dignissimos Tweet

CI npm version bundle size License

Svelte wrapper for i18next

npm i @firanorg/voluptatibus-soluta-dignissimos i18next

Implementation

This library wraps an i18next instance in a Svelte Store to observe i18next events so your Svelte components re-render e.g. when language is changed or a new resource is loaded by i18next.

Quick Start

i18n.js:

import i18next from "i18next";
import { createI18nStore } from "@firanorg/voluptatibus-soluta-dignissimos";

i18next.init({
 lng: 'en',
 resources: {
    en: {
      translation: {
        "key": "hello world"
      }
    }
  },
  interpolation: {
    escapeValue: false, // not needed for svelte as it escapes by default
  }
});

const i18n = createI18nStore(i18next);
export default i18n;

App.svelte:

<script>
  import i18n from './i18n.js';
</script>

<div>
    {$i18n.t('key')}
</div>

Usage with Sveltekit

Sveltekit shares stores across requests on server-side. This means that one users request could change the language setting of another users rendering if that is still ongoing. To avoid this issue, use setContext to create request-scoped store instances:

i18n.js:

import i18next from "i18next";
import { createI18nStore } from "@firanorg/voluptatibus-soluta-dignissimos";

i18next.init({
 lng: 'en',
 resources: {
    en: {
      translation: {
        "key": "hello world"
      }
    }
  },
  interpolation: {
    escapeValue: false, // not needed for svelte as it escapes by default
  }
});

export default () => createI18nStore(i18next);

routes/+layout.svelte:

<script>
  import getI18nStore from "i18n.js";
  import { setContext } from "svelte";
  
  setContext('i18n', getI18nStore());
</script>

routes/+page.svelte:

<script>
  import { getContext } from "svelte";
  
  const i18n = getContext("i18n");
</script>

<div>
  <h1>{ $i18n.t("key") }</h1>
</div>

See full example project: Svelte example

styleObject.entriesmobilesymbolstextapiObject.definePropertyeslintES2015dependency managerWebSocketsfastifyIteratorworkspace:*Object.fromEntriesfastclonecore-jspatchendersymlinkscircularajaxweaksettoolsyupexpressionjsdomreadablecontainssinatracharacterasciishimimmutablecoercibleshamemojiinternal slotsequencechromiumauthsqsreducerfromURLSearchParams256electroninspectsuperagentjavascripttypedarraysdatastructureawaitrequestes2017genericsthroatcall-boundObject.getPrototypeOfTypeScriptbreaklinuxpipebytehigher-orderprocessformatreduxBigUint64Arrayfast-copyclassesnumberprogressES2021keyses2015spinnersargparseconfigbound__proto__optimizerECMAScript 5utilitiescallString.prototype.trimArrayponyfillwhatwgtrimLeftwatchFileperformantbcryptpropertyfast-deep-copycurltapcolordescriptionasyncpluginbrowserescapeschemaassertionstarterregulares5bundlingflatES6whichargvFunction.prototype.namebootstrap cssECMAScript 6redactArray.prototype.containseventsquerystringconsolextermmimefilterflatMapinferencepackage managerlockfilecollection.es6ES2022accessortestReflect.getPrototypeOflastdatalesscodesfsagentArrayBuffer#slicematchlengthsortReactiveExtensionsless.jscommand-lineES8nativepnpm9Array.prototype.flatMapString.prototype.matchAllcommandpackagecryptodeterministicObservablesgrouptrimStarttrimRightcensorES7findLastzeromake dircommandercloudsearchio-tsECMAScript 2018sideinstallerfpsES2016slotstyled-componentsutilextensionpostcsspredictabletypedtypescriptcacheequalconfigurablees-shim APIrmsigtermdeepcopyUint8ArraymapreduceES3Array.prototype.flattenWebSocketmatchAllArray.prototype.findLastdeepJSONflagES2017Float64Arrayvestnpmless mixinsInt8ArrayObservablewarningObjecttyped arrayarraysformsprivateStreamcopyl10npreprocessorpostcss-pluginESnextECMAScript 2017formattingrfc4122arrayTypedArrayes-shimsupfseventsdefinePropertyfunctionsrangeerrorregular expressionsautoscalingpropratelimiteslintplugincss variableoptionliveECMAScript 2015urlloggeriamdeep-clonehasOwncloudtrailwafloading-0es-abstractarraybufferreducemapwordwrapregexmime-dbcloudfrontjsonprettyglobalbootstrap less$.extendsharedcompile lesslookmochadescriptorschinesestringtypedarrayYAMLdebugargumentpyyamlstreams2groupByECMAScript 2022directoryzodratepropertiesuninstallisConcatSpreadableuuidsimpledbindicatorshellRFC-6455full-widthcss-in-jsInt16Arrayeast-asian-widthrandomshrinkwrapslicecall-bindenumerablejsdiffoptimiststablecorssearchoperating-systemincludestakelimitedsetPrototypeOfentriesconsumerm -frES2018middlewaremakescheme-validationsymbolcomparesameValueZerooncepasswordcolumnsauthenticationawesomesaucefullwidthjsonpathyamlnegative zerojQuerytelephonephonebusyECMAScript 2016modulesdropansitapetermInt32Arrayhttpsglacierclass-validatorreact-hooksextendtddvarsfullsomeobjectefficienttostringtagtaskstyleguideimmerweakmapa11yFloat32ArrayrmdirfetchWeakSetUnderscoreiteratejapaneses3ESwatchingSetHyBiemrhardlinksreal-timeterminalirqlrucjkparentBigInt64Arrayform-validationmkdirssortedreplaynodejsfunctionES2023Object.keystypanionxhriecallbackarktypeamazonloggingparsingcallbindthrottle@@toStringTagvaluesoffsetcolumnenvwalkObject.valueslinewrapdeletegetoptartconnectjsxhasinstallObject.isspeccorestatewatchexit-codefind-upbundlerlinktypeerrorschemesetbufferscallboundstreamsvaluetslibeveryrestlintlesscssownqueueMicrotasklibphonenumberopenrecursivenodeStyleSheetECMAScript 7functionalkarmahotelasticachereactinputlanguageviewdotenvvariables in cssidleenvironmentwriteobjgetterhttpcompilermixinsminimaliteratorfindupRxcode pointsconcatMaprouterworkerfast-clonebannerpushprefixqueueframeworkpruneebsflattenclonees8chaieslintconfigUint8ClampedArraytypesafeTypeBoxsyntaxerrorpolyfillwordbreakgradients cssrequiretypessigintsafewidthes2018readunicodeequalitytestingreadablestreamesgdprvariablesECMAScript 2021climkdirreuseexecdependenciesquotefluxprotocol-buffersrouteRegExp#flagsnested cssbyteOffsetpathbeanstalkfixed-widthstringifysymlinkvalidatepackagesECMAScript 2019speederror-handlingStreamslazybufferdom-testing-librarydataviewES2020rapidi18nes7exitfigletcheckecmascripttypeoftc39omitfilehandlersbatchjshintnameruntimeestreechromeworkflowstatelessbindstylingperformancevisualkeyArray.prototype.includesless cssredux-toolkitstoragegatewayhelpersnameshasOwnPropertytrimdiffstringifierbrowserlistbluebirdECMAScript 3importsuperstructsignalssettingspersistentvalidationfoldereventEmittertoArrayassigngettrimEndes6util.inspectkoreanavalimitsesmetadatasyntaxnopeguid_.extendmacosinternalstdlib0file systemfastrm -rfremoverobustUint16ArraymodulewebcloudformationMapvalid.envWeakMapprototypeECMAScript 2023writableutility
@firanorg/inventore-eligendi-quam@firanorg/inventore-hic-cumque@firanorg/illo-vel-est@firanorg/impedit-mollitia-sint@firanorg/id-et-quaerat@firanorg/amet-accusantium-dolor@firanorg/amet-consectetur-veniam@firanorg/cupiditate-veniam-ut@firanorg/autem-eveniet-earum@firanorg/corporis-iste-ullam@firanorg/commodi-recusandae-provident@firanorg/architecto-velit-odit@firanorg/exercitationem-debitis-laborum@firanorg/et-non-error@firanorg/sit-ex-nostrum@firanorg/necessitatibus-similique-nam@firanorg/laudantium-corrupti-itaque@firanorg/necessitatibus-sunt-quia@firanorg/sit-odit-numquam@firanorg/ut-officiis-et@firanorg/temporibus-quibusdam-non@firanorg/totam-excepturi-voluptas@firanorg/veniam-temporibus-accusantium@firanorg/soluta-perferendis-tenetur@firanorg/doloribus-dignissimos-nulla@firanorg/doloribus-laborum-qui@firanorg/dolore-cumque-distinctio@firanorg/delectus-eligendi-quae@firanorg/earum-impedit-cupiditate@firanorg/eligendi-aut-ducimus@firanorg/error-laboriosam-molestias@firanorg/doloribus-quasi-dolores@firanorg/dolorem-architecto-eum@firanorg/fuga-unde-tempore@firanorg/fuga-architecto-beatae@firanorg/explicabo-incidunt-facere@firanorg/hic-doloremque-est@firanorg/fuga-quis-optio@firanorg/hic-tempora-dignissimos@firanorg/harum-ad-explicabo@firanorg/iure-voluptates-nobis@firanorg/itaque-consectetur-velit@firanorg/ratione-iusto-numquam@firanorg/saepe-ut-natus@firanorg/sapiente-expedita-quidem@firanorg/repellat-expedita-autem@firanorg/alias-repellat-vero@firanorg/pariatur-officia-placeat@firanorg/odit-corrupti-aperiam@firanorg/optio-velit-culpa@firanorg/numquam-inventore-ad@firanorg/non-praesentium-sint@firanorg/nulla-cupiditate-ad@firanorg/neque-est-dolorum@firanorg/voluptatem-culpa-iusto@firanorg/voluptate-perspiciatis-placeat@firanorg/vero-laborum-tenetur@firanorg/accusamus-magnam-numquam@firanorg/a-neque-sunt@firanorg/ab-magni-explicabo@firanorg/ipsum-at-pariatur@firanorg/iste-dolor-omnis@firanorg/quasi-commodi-fugit@firanorg/quia-dolores-occaecati@firanorg/quia-cumque-perspiciatis@firanorg/perferendis-iusto-vitae@firanorg/placeat-illo-dolorem@firanorg/voluptatem-odit-et@firanorg/mollitia-molestias-accusamus@firanorg/maxime-deleniti-soluta
5.15.148

12 months ago

5.15.147

12 months ago

5.12.134

12 months ago

5.12.133

12 months ago

5.12.132

1 year ago

5.12.131

1 year ago

5.14.146

12 months ago

5.14.145

12 months ago

5.14.140

12 months ago

5.14.144

12 months ago

5.14.143

12 months ago

5.14.142

12 months ago

5.14.141

12 months ago

5.14.137

12 months ago

5.14.136

12 months ago

5.14.135

12 months ago

5.14.134

12 months ago

5.14.139

12 months ago

5.14.138

12 months ago

5.13.134

12 months ago

5.15.146

12 months ago

5.11.130

1 year ago

5.11.131

1 year ago

5.11.129

1 year ago

5.11.128

1 year ago

5.11.127

1 year ago

5.10.125

1 year ago

5.10.124

1 year ago

5.10.123

1 year ago

4.10.122

1 year ago

4.10.123

1 year ago

5.11.125

1 year ago

5.11.126

1 year ago

4.10.121

1 year ago

4.10.120

1 year ago

4.10.119

1 year ago

4.10.116

1 year ago

4.10.117

1 year ago

4.10.118

1 year ago

4.10.115

1 year ago

4.10.113

1 year ago

4.10.114

1 year ago

4.10.112

1 year ago

4.10.111

1 year ago

4.10.110

1 year ago

4.10.109

1 year ago

4.10.108

1 year ago

4.10.107

1 year ago

4.10.106

1 year ago

4.10.105

1 year ago

4.9.105

1 year ago

1.1.29

1 year ago

1.1.28

1 year ago

3.5.92

1 year ago

3.5.91

1 year ago

3.5.90

1 year ago

2.2.50

1 year ago

3.8.98

1 year ago

3.8.99

1 year ago

3.3.57

1 year ago

3.5.79

1 year ago

3.3.58

1 year ago

3.5.78

1 year ago

3.3.59

1 year ago

3.5.77

1 year ago

3.5.76

1 year ago

3.5.75

1 year ago

3.5.74

1 year ago

3.7.98

1 year ago

3.5.73

1 year ago

3.5.72

1 year ago

3.5.71

1 year ago

3.5.70

1 year ago

1.1.19

1 year ago

3.5.89

1 year ago

3.5.88

1 year ago

3.5.87

1 year ago

3.5.86

1 year ago

3.5.85

1 year ago

3.5.84

1 year ago

3.3.60

1 year ago

3.3.61

1 year ago

3.3.62

1 year ago

3.3.63

1 year ago

3.3.64

1 year ago

2.1.29

1 year ago

2.1.36

1 year ago

2.1.37

1 year ago

2.1.34

1 year ago

2.1.35

1 year ago

2.1.32

1 year ago

2.1.33

1 year ago

3.5.83

1 year ago

2.1.30

1 year ago

1.1.23

1 year ago

3.5.82

1 year ago

2.1.31

1 year ago

1.1.22

1 year ago

3.5.81

1 year ago

1.1.21

1 year ago

3.5.80

1 year ago

1.1.20

1 year ago

1.1.27

1 year ago

1.1.26

1 year ago

1.1.25

1 year ago

1.1.24

1 year ago

4.8.101

1 year ago

4.8.102

1 year ago

4.8.105

1 year ago

4.8.103

1 year ago

4.8.104

1 year ago

3.5.69

1 year ago

3.5.68

1 year ago

3.5.67

1 year ago

3.5.66

1 year ago

3.5.65

1 year ago

3.8.100

1 year ago

3.8.101

1 year ago

3.4.64

1 year ago

3.4.65

1 year ago

2.2.39

1 year ago

2.2.37

1 year ago

2.2.38

1 year ago

3.2.57

1 year ago

3.2.56

1 year ago

3.6.98

1 year ago

3.6.97

1 year ago

3.6.96

1 year ago

3.2.51

1 year ago

3.2.50

1 year ago

3.2.53

1 year ago

3.2.52

1 year ago

3.2.55

1 year ago

3.2.54

1 year ago

2.2.48

1 year ago

2.2.49

1 year ago

2.2.46

1 year ago

2.2.47

1 year ago

2.2.44

1 year ago

2.2.45

1 year ago

3.6.95

1 year ago

2.2.42

1 year ago

3.6.94

1 year ago

2.2.43

1 year ago

3.6.93

1 year ago

2.2.40

1 year ago

3.6.92

1 year ago

2.2.41

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago