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

Add multi language support #31

Closed
adrianjost opened this issue Apr 7, 2018 · 2 comments
Closed

Add multi language support #31

adrianjost opened this issue Apr 7, 2018 · 2 comments
Assignees

Comments

@adrianjost
Copy link

I want to use this cool list of color names in an project where I need to translate german color names to hex values. So is it possible to add multi language support?

Maybe by exporting it in a way like:

{
  "en": [
    {"name":"red", "hex":"#ff0000"},
    {"name":"green", "hex":"#00ff00"},
    {"name":"blue", "hex":"#0000ff"}
  ],
  "de": [
    {"name":"rot", "hex":"#ff0000"},
    {"name":"grün", "hex":"#00ff00"},
    {"name":"blau", "hex":"#0000ff"}
  ] 
}

then you can use it like:

const namedColors = require('color-name-list');
const someEnColor = namedColors.en.find(color => color.name === "red");
// or
const someDeColor = namedColors.de.find(color => color.name === "rot");
console.log(someEnColor, someDeColor );
@meodai
Copy link
Owner

meodai commented Apr 7, 2018

Hey I like this idea. If you want to maintean a https://github.com/meodai/color-names/blob/master/src/colornames.DE-de.csv I would be happy to accept your pull request and think of a way to adapt the output. I don't think they should live in the same file though.

@meodai
Copy link
Owner

meodai commented May 16, 2018

I will close this issue for now.

@meodai meodai closed this as completed May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants