Playcanvas API function Not Working

I have tried calling findAvailableLocale in localization:

But console throughs an error:

Please check

looking at the source code, the function is static

so should be called as I18n.findAvailableLocale(...

I’m not sure why it’s not marked as static in the documentation though … we’ll need to fix this @yaustar

Even if I call it as I18n.findAvailableLocale:

It says I18n is not defined.


pc.I18n.findAvailableLocale('en-US', {});

Odd, it’s marked as static: engine/i18n.js at 01cddc1ca983628d023ff5c9920955001eda3104 · playcanvas/engine · GitHub

Edit: fixed: Fixed static method API docs for i18n.findAvailableLocale by yaustar · Pull Request #3243 · playcanvas/engine · GitHub

Thanks for the quick response, it worked as you mentioned. :slight_smile:

I recommend adding a single line of “usage” in front of all functions.

1 Like