How Do You Source Common Elements Like Countries, Languages, and Currencies for Your Project?

0
33
Asked By TechieTom23 On

I'm deep into a project right now and I've been saving currencies and languages as simple IDs (like 'en' for English, 'de' for German) in my database. But I'm realizing that showing these in the UI is a whole different ball game—most users won't know that 'de' means Germany! I've looked into some APIs, but I'm not sure which ones are reliable. I'm considering creating my own API or container, but I thought I'd reach out to see what you all do for these common elements. Any tips or resources?

5 Answers

Answered By InteractiveNinja69 On

You're on the right track by using IDs internally! Just make sure to display readable names or icons in the UI. Users won't associate 'de' with Germany unless you give them extra context.

Answered By LibraryHunter42 On

If you're sticking to ISO standards, there are tons of libraries and APIs available that can translate those IDs into user-friendly names and flags. For instance, I use flagcdn.com for icons—great for displaying country flags alongside their codes!

Answered By QuickGoogleFinder On

Don't forget that a simple Google search can point you towards a lot of useful resources!

Answered By ScraperWizard91 On

If you're up for a bit of coding, you could write a JavaScript snippet to scrape country codes and names from Wikipedia and convert that into a CSV or JSON. Be careful with relying on AI like ChatGPT for names, though; it's likely to have inaccuracies that could trip you up later. You could also use simple scripts to scrape multiple pages for a comprehensive database of countries, currencies, and languages.

Answered By CodeCrafter88 On

You can take advantage of various frameworks like Vue, React, or Angular. For each language, maintain a JSON file with tokens (like 'en' for English, 'de' for German) that correspond to the text you want to display. Additionally, the Intl interface in JavaScript is super helpful for localizing text, including country names, currencies, and dates.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.