diff --git a/README.md b/README.md index 4457829..527ca36 100644 --- a/README.md +++ b/README.md @@ -378,7 +378,7 @@ i18n.runWithLocale(locale, func) ## Integrations -This section showcases some of the ways of integrating `universe:i18n` with different frameworks. More detailed examples can be found in the `integrations` directory. +This section showcases some of the ways of integrating `universe:i18n` with different frameworks. More detailed examples can be found in the [`integrations` directory](https://github.com/vazco/meteor-universe-i18n/blob/master/integrations). ### Integration with React diff --git a/integrations/blaze/App.html b/integrations/blaze/App.html index c41af4a..bc4400e 100644 --- a/integrations/blaze/App.html +++ b/integrations/blaze/App.html @@ -9,5 +9,5 @@

Example of i18n

diff --git a/integrations/blaze/en.i18n.yml b/integrations/blaze/locales/en.i18n.yml similarity index 53% rename from integrations/blaze/en.i18n.yml rename to integrations/blaze/locales/en.i18n.yml index 3b7281f..8ab92f1 100644 --- a/integrations/blaze/en.i18n.yml +++ b/integrations/blaze/locales/en.i18n.yml @@ -1,3 +1,3 @@ _locale: en ok: Okay -test: Test +dog: Dog diff --git a/integrations/blaze/locales/es.i18n.yml b/integrations/blaze/locales/es.i18n.yml new file mode 100644 index 0000000..b3d3fd7 --- /dev/null +++ b/integrations/blaze/locales/es.i18n.yml @@ -0,0 +1,3 @@ +_locale: es +ok: Bien +dog: Perro diff --git a/integrations/blaze/reactivei18n.ts b/integrations/blaze/reactivei18n.ts index fe140f6..e91cc75 100644 --- a/integrations/blaze/reactivei18n.ts +++ b/integrations/blaze/reactivei18n.ts @@ -2,7 +2,8 @@ import { i18n } from 'meteor/universe:i18n'; import { Template } from 'meteor/templating'; import { ReactiveVar } from 'meteor/reactive-var'; -import './en.i18n.yml'; +import './locales/en.i18n.yml'; +import './es/en.i18n.yml'; import './main.html'; const localeReactive = new ReactiveVar(i18n.getLocale()); diff --git a/integrations/react/App.tsx b/integrations/react/App.tsx index 2a09531..af0cb7f 100644 --- a/integrations/react/App.tsx +++ b/integrations/react/App.tsx @@ -9,7 +9,6 @@ const Example = () => { Are you sure? - ); }; diff --git a/integrations/react/en.i18n.yml b/integrations/react/en.i18n.yml deleted file mode 100644 index cdbf93d..0000000 --- a/integrations/react/en.i18n.yml +++ /dev/null @@ -1,6 +0,0 @@ -_locale: en -hi: Hello -ok: Okay -apple: Apple -dog: Dog -company.placeholder: Something diff --git a/integrations/react/locales/en.i18n.yml b/integrations/react/locales/en.i18n.yml new file mode 100644 index 0000000..8ab92f1 --- /dev/null +++ b/integrations/react/locales/en.i18n.yml @@ -0,0 +1,3 @@ +_locale: en +ok: Okay +dog: Dog diff --git a/integrations/react/locales/es.i18n.yml b/integrations/react/locales/es.i18n.yml new file mode 100644 index 0000000..b3d3fd7 --- /dev/null +++ b/integrations/react/locales/es.i18n.yml @@ -0,0 +1,3 @@ +_locale: es +ok: Bien +dog: Perro diff --git a/integrations/react/reactivei18n.tsx b/integrations/react/reactivei18n.tsx index e874ed9..fb7eac8 100644 --- a/integrations/react/reactivei18n.tsx +++ b/integrations/react/reactivei18n.tsx @@ -7,7 +7,8 @@ import React, { useContext, } from 'react'; -import './en.i18n.yml'; +import './locales/en.i18n.yml'; +import './locales/es.i18n.yml'; const localeContext = createContext(i18n.getLocale()); diff --git a/integrations/svelte/App.svelte b/integrations/svelte/App.svelte index ca93dcd..0d1f52a 100644 --- a/integrations/svelte/App.svelte +++ b/integrations/svelte/App.svelte @@ -20,21 +20,20 @@
Locale: {$locale}
- hi: {$t('hi')}
ok: {$t('ok')}
- apple: {$t('apple')} + dog: {$t('dog')}

Locale to update: -
+
Key to update: -
+
New value: -
+