- perf:
ResourceStore.hasLanguageSomeTranslations()no longer enumerates every key of a large bundle on each call. It ranObject.keys()on the whole bundle just to learn whether it had at least one key, andinit()/changeLanguage()reach it three times per instance (once while picking the language, twice viasetResolvedLanguage()). With large flat bundles and one i18next instance per SSR request reusing the same resources, that showed up as measurable CPU work before anyt()call. Bundle objects already found non-empty are now remembered in aWeakSetshared across instances, so later checks are O(1): 2,000 inits with a 6,800-key bundle went from ~750 ms to ~20 ms, the same as a one-key bundle. Only the non-empty result is cached. No API removes single keys from a bundle, so a non-empty bundle stays non-empty, and empty bundles are re-checked every time, so keys added later (backend loads,addResource,addResourceBundle, direct or silent changes) count right away. The only edge case: a bundle emptied by hand withdeleteon every key while it is still in the store keeps counting as having translations; useremoveResourceBundle()for that. Thanks @dmchoi77 for the detailed report (#2449).