i18next / i18next-icu

i18nFormat plugin to use ICU format with i18next
MIT License
81 stars 17 forks source link

IDE autocomplete: annoying short locale data names #23

Closed Vovan-VE closed 4 years ago

Vovan-VE commented 4 years ago

In my previous PR #13 I did introduce TS declarations including all locale data as modules. Every locale module was declared as following:

declare module "i18next-icu/locale-data/en" {
  import { LocaleData } from "i18next-icu";
  const en: LocaleData;
  export default en;
}

It was my mistake. Now when we start to type some local symbol name lazily relying to IDE autocompletion, then one of that short locale data modules may appear at the first place in autocompletion list if its name exactly match with first letters your did type. Here are examples:

const a = ne // you mean `next`, but see `ne` locale import first
const b = ce // you mean `cert` or `cent...`, but see `ce` locale import
const c = af // you mean `after`, but see `af` locale import first
const d = be // you mean `before...`, but see `be` locale import first
be           // you mean `beforeAll(`, but see `be` locale import first

Since there are lots of locales existing and declared, we may hit same annoying autocompletion mess very often.

Some screenshots to demonstrate the problem: i18next-icu af i18next-icu be i18next-icu ce i18next-icu ne

And how it should/would be after applying this fix: i18next-icu fixed

jamuhl commented 4 years ago

thank you...was published in i18next-icu@1.3.1