Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hei any idea why my localizationManager is not working ?
I have api version 2.3
Solved! Go to Solution.
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.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
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.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
@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
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
@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
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