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

Spanish Translation Integration #59

Closed
MrBenJ opened this issue Oct 23, 2018 · 6 comments
Closed

Spanish Translation Integration #59

MrBenJ opened this issue Oct 23, 2018 · 6 comments
Labels
👀 no/external This makes more sense somewhere else

Comments

@MrBenJ
Copy link

MrBenJ commented Oct 23, 2018

I need some help on where to get started with integrating the Spanish wordlist from words/cuss. If anyone has a hint or idea of where to get started, that would be greatly appreciated :)

@wooorm
Copy link
Member

wooorm commented Oct 24, 2018

@MrBenJ Thanks for opening this! I appreciate it! 👍

The words from words/cuss can go in retext-profanities! See retextjs/retext-profanities#10 for some more info. What we need there is something to split the current index.js into a factory.js (or so), and an en.js (or maybe just index.js) that uses factory to create a file for English. So all the logic should go in factory.js, and it should expose a function that’s given the English cuss results.

For this plugin (retext-equality), I suggest doing something similar, but we still need phrases in other languages!

@wooorm
Copy link
Member

wooorm commented Nov 1, 2018

In retext-profanities we now have a factory that kind of does what I envisioned here for i18n as well, e.g., by Spanish like so. But it’s just an example, so the implementation here would be different!

@MrBenJ
Copy link
Author

MrBenJ commented Nov 1, 2018 via email

@MrBenJ
Copy link
Author

MrBenJ commented Nov 1, 2018

I looked at retext-profanities and saw the approach from there with factory.js. Is that kind of approach what you're looking for in this repo?

@wooorm
Copy link
Member

wooorm commented Nov 1, 2018

@MrBenJ Yeah, I believe so. Something like that makes the most sense to me?
retext-equality is a bit different because it has all the patterns itself, in YAML files, so we also need to support building multiple languages though.

@wooorm
Copy link
Member

wooorm commented Jun 7, 2019

I rewrote the library to support other languages! To add a new language:

  1. Create a new directory data/es/ (in this case es because it’s the BCP 47 tag for Spanish)
  2. Add some patterns!
  3. npm test should generate the rest 🦄

I’ll close this here now because I think the next step is for someone to create a PR adding a language.

@wooorm wooorm closed this as completed Jun 7, 2019
@wooorm wooorm added the 👀 no/external This makes more sense somewhere else label Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else
Development

No branches or pull requests

2 participants