overextended / ox_lib

A FiveM resource and script library for Lua and JS.
https://overextended.dev/ox_lib
GNU Lesser General Public License v3.0
314 stars 415 forks source link

[Bug] Js package initializing locales automaticaly #635

Closed luxu-gg closed 3 weeks ago

luxu-gg commented 2 months ago

When using the js package, locale function is automaticaly initialized with initLocale(), fetching for the resource's locales/ folder. https://github.com/overextended/ox_lib/blob/5ac07d8b887aa2f1e68e5e3bec6497345aff7bbe/package/shared/resource/locale/index.ts#L90

This is not optimal since we may not wish to use the lib's locales functionality. The main issue is, it attempts to find a locale that might not be present, producing a console warning.

This is a very low priority issue but I have received quite a few reports since it sometimes leads users to believe something might be broken.

LukeWasTakenn commented 2 months ago

Changing this would probably be breaking as it would force you to initialize the locales yourself in your scripts 🤔

So maybe it's best to leave it for now, until the next major version?

thelindat commented 1 month ago

If you're not importing the locales module then it shouldn't be included in your build.