Closed nuwen closed 2 years ago
Hi @nuwen thanks for posting the issue. Sounds like it has something to do with localization. Are you seeing any errors in the console? Can you create a reproduction on codesandbox?
Here's an example where the summary and localization are working: https://codesandbox.io/s/zen-frog-8khlf
Hi @mdodgelooker thanks for your response and the codesandbox for reference it did help me solve a few things.
I did copy your example, commented out my code, and made sure I had up to date versions for my dependencies. The mentioned steps did resolve the empty string, however the translations did not work unfortunately.
One key difference I have is that I have the example code wrapped in an <ExtensionProvider2 />
component from @looker/extension-sdk-react
<ExtensionProvider2 type={Looker40SDK}>
<ComponentsProvider resources={i18nResources} locale="de-DE">
<FilterToken name="Age" expressionType="date" expression="10 month" />
</ComponentsProvider>
</ExtensionProvider2>
I don't think there would be any configuration needed from the manifest/lookML to implement whats written for the ComponentsProvider
is there?
Thank You
Hi @nuwen I'm glad to hear the empty string issue is resolved. As for localization, I have a couple questions:
i18nResources
being imported from @looker/filter-components
specifically? The other packages have this export as well but it's a small subset of the translations required for filters.i18nInit()
being called separately. Earlier versions of the package required this but it is no longer required, and calling it without the intended locale would overwrite the localeProp
passed to ComponentsProvider
.Hi @mdodgelooker
Your question in #2 pointed me in the right direction, we were loading i18n in HOC further up the tree, was able to integrate i18nResources
with our translations.
Thank you so much
Hello I'm trying to utilize the
FilterToken
component to render out a date type expression in the example belowHowever it renders an empty string within my application, I have tested the code block above on the StoryBook example sandbox and it correctly does render there as
but when used in my extension application it shows up as
in addition I also did try the
summary
function provided from@looker/filter-expressions
shown in the docs on https://www.npmjs.com/package/@looker/filter-expressions, however again an empty string is rendered. Example code belowI do have both the following packages installed
I would also like to add a note that internationalization of
Filter
does not appear to be working eitherThank you