cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mikihiir Helper III
Helper III

LocalizationManager resources is undefined

Hei any idea why my localizationManager is not working ?

 

 

jant1.pngjant2.png

 

I have api version 2.3

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-viig Community Champion
Community Champion

Re: LocalizationManager resources is undefined

Localization resources are not included if you run pbiviz start (debug visual).

To test localization you should generate a package by using pbiviz package and import it into Power BI.

 

Let us know if it resolves the issue.

 

image.png

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

 

View solution in original post

5 REPLIES 5
v-viig Community Champion
Community Champion

Re: LocalizationManager resources is undefined

Localization resources are not included if you run pbiviz start (debug visual).

To test localization you should generate a package by using pbiviz package and import it into Power BI.

 

Let us know if it resolves the issue.

 

image.png

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

 

View solution in original post

ChrisWilliams Helper II
Helper II

Re: LocalizationManager resources is undefined

@v-viig Do you have any idea if LocalizationManager resources will ever be available when running pbiviz start?  I have resources defined that have templating parameters for data substitution.  They don't work at all when I'm building the app, which means I really can't do localization.

 

For example, here's a templating string that I use for displaying dates:

en-US

"DateYMD": "{month} {day}, {year}",

ja-JP:

"DateYMD": "{year}年{month}月{day}日",

 

Obviously I format through the bracketed values to display dates for my supported languages, but I can't do this during development which is a real pain.  I know I can use moment.js for dates, but this is just one of many examples, most of which are not date-related.

 

Any news on this or recommended workarounds?

 

Chris

Microsoft
Microsoft

Re: LocalizationManager resources is undefined

Hi Chris,

 

pbiviz start still doesn't support LocalizationManager and I'm unsure will it be in the future or not.

As I understand, your localization doesn't work at all even if you build a package an import it, correct?

If so, please send your source code to pbicvsupport@microsoft.com and I will look at it to find an issue.

 

Kind Regards,

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visu

ChrisWilliams Helper II
Helper II

Re: LocalizationManager resources is undefined


@v-evelk wrote:

As I understand, your localization doesn't work at all even if you build a package an import it, correct?

No, that's not quite accurate. If I build and import, then I can get the localized variables as expected. 

 

However, I write and debug the app in the developer visual.  While in the debugger visual, I make a localization request to get "DateYMD" and it returns "DateYMD" instead of "{month} {day}, {year}" for example.  My code relies on substituting the month value for {month}, the day value for {day} and the year value for {year} in the localized string so that I can properly display dates. 

 

As I mentioned, date display is only one example, and I have other needs to change strings based on current user locale.

 

However, because I can't get a string back from localizationManager while in the developer visual that includes {month} {day} {year} my string substitution fails.

 

A potential workaround would be to only return en-US or some other default locale while in the developer visual.  That would give me at least some data to work with.  The only thing I can think of now is to name the field something like {month}{day}{year} which seems wierd but maybe that would work.

 

Chris

Microsoft
Microsoft

Re: LocalizationManager resources is undefined

Ok, got it now!

 

You could provide some checks before formatting and substitution applying to avoid failures (as checking that string contains "{}")?

Yes, labels will be looked ugly, but your code will work under any conditions.

 

Kind Regards,

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

Helpful resources

Announcements
‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.