merchant-backoffice

ZZZ: Inactive/Deprecated
Log | Files | Refs | Submodules | README

commit 1409f599d5c3ba5cf75b597fb38757fcd8e9f02f
parent 755a08143b94aca4edc08eed6d55e56d6cae1625
Author: Sebastian <sebasjm@gmail.com>
Date:   Thu, 27 May 2021 11:01:07 -0300

removing message-po and testing on storybook

Diffstat:
Mpackages/frontend/.storybook/main.js | 24++++++++++++------------
Mpackages/frontend/.storybook/preview.js | 1+
Mpackages/frontend/preact.config.js | 32++++++++++++++++----------------
Mpackages/frontend/src/i18n/index.tsx | 6+++---
4 files changed, 32 insertions(+), 31 deletions(-)

diff --git a/packages/frontend/.storybook/main.js b/packages/frontend/.storybook/main.js @@ -35,18 +35,18 @@ module.exports = { // You can change the configuration based on that. // 'PRODUCTION' is used when building the static version of storybook. // Make whatever fine-grained changes you need - config.module.rules.push({ - test: [/\.pot?$/, /\.mo$/], - loader: require.resolve('messageformat-po-loader'), - options: { - biDiSupport: false, - defaultCharset: null, - defaultLocale: 'en', - forceContext: false, - pluralFunction: null, - verbose: false - } - }); + // config.module.rules.push({ + // test: [/\.pot?$/, /\.mo$/], + // loader: require.resolve('messageformat-po-loader'), + // options: { + // biDiSupport: false, + // defaultCharset: null, + // defaultLocale: 'en', + // forceContext: false, + // pluralFunction: null, + // verbose: false + // } + // }); // Return the altered config return config; }, diff --git a/packages/frontend/.storybook/preview.js b/packages/frontend/.storybook/preview.js @@ -17,6 +17,7 @@ import "../src/scss/main.scss" import { ConfigContextProvider } from '../src/context/config' import { TranslationProvider } from '../src/context/translation' +import { h } from 'preact'; const mockConfig = { backendURL: 'http://demo.taler.net', diff --git a/packages/frontend/preact.config.js b/packages/frontend/preact.config.js @@ -39,23 +39,23 @@ export default { ); // allow import for gettext files - config.resolve.extensions.push('.po'); + // config.resolve.extensions.push('.po'); // transform .po format into messageformat - config.module.rules.push({ - enforce: 'pre', - test: /\.po$/, - use: [{ - loader: 'messageformat-po-loader', - options: { - biDiSupport: false, - defaultCharset: null, - defaultLocale: 'en', - forceContext: false, - pluralFunction: null, - verbose: false - } - }], - }); + // config.module.rules.push({ + // enforce: 'pre', + // test: /\.po$/, + // use: [{ + // loader: 'messageformat-po-loader', + // options: { + // biDiSupport: false, + // defaultCharset: null, + // defaultLocale: 'en', + // forceContext: false, + // pluralFunction: null, + // verbose: false + // } + // }], + // }); // config.plugins.push(new I18n()) } diff --git a/packages/frontend/src/i18n/index.tsx b/packages/frontend/src/i18n/index.tsx @@ -135,7 +135,7 @@ export function Translate({ children }: TranslateProps): VNode { const ctx = useTranslationContext() const translation: string = ctx.handler.ngettext(s, s, 1); const result = getTranslatedChildren(translation, children) - return <>{result}</>; + return <Fragment>{result}</Fragment>; } /** @@ -188,7 +188,7 @@ export function TranslatePlural({ children, target }: TranslationPluralProps): V const ctx = useTranslationContext() const translation = ctx.handler.ngettext(s, s, 1); const result = getTranslatedChildren(translation, children); - return <>{result}</>; + return <Fragment>{result}</Fragment>; } /** @@ -199,6 +199,6 @@ export function TranslateSingular({ children, target }: TranslationPluralProps): const ctx = useTranslationContext() const translation = ctx.handler.ngettext(s, s, target); const result = getTranslatedChildren(translation, children); - return <>{result}</>; + return <Fragment>{result}</Fragment>; }