Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The documentation is confusing. #316

Open
Reanukeaves opened this issue Dec 8, 2022 · 2 comments
Open

The documentation is confusing. #316

Reanukeaves opened this issue Dec 8, 2022 · 2 comments

Comments

@Reanukeaves
Copy link

How I got it to work:

In your component:

import * as i18nIsoCountries from "i18n-iso-countries";

If you use i18n-iso-countries with Node.js you're done.

Except you do

const countryCodestoCountryNames = (countryCode: string) => {
    var countries = require("i18n-iso-countries");
    i18nIsoCountries.registerLocale(
      require("i18n-iso-countries/langs/en.json")
    );
    return countries.getName(countryCode, "en", { select: "official" });
  };
@jcalfee
Copy link

jcalfee commented Apr 17, 2023

How is the browser example minimized to save space?

@jcalfee
Copy link

jcalfee commented Apr 17, 2023

In node I just do this const en = require('i18n-iso-countries/langs/en.json') .. but in the browser I'm needing to figure out how to use Import due to Node (unfortunately in my opinion) really limiting their loaders for import making it very difficult to just import a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants