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

[feat] Adds language option #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tsvetan-ganev
Copy link

  • Adds a language option for the source string
  • Adds setLanguagesConfig() method to set language rules
  • Adds default language rules for the most popular Cyrillic languages
  • Adds tests for the new features
  • Updates README.md to reflect the new feature
  • Fixes ESLint errors/warnings
  • Fixes .zuul.yml to point to the correct script file

- Adds a language option for the source string
- Adds `setLanguagesConfig()` method to set language rules
- Adds default language rules for the most popular Cyrillic languages
- Adds tests for the new features
- Updates README.md to reflect the new feature
- Fixes ESLint errors/warnings
- Fixes .zuul.yml to point to the correct script file
@a-katsarov
Copy link

Related to: #56

@dzcpy
Copy link
Owner

dzcpy commented Jul 14, 2018

Thanks for your contribution. However, using 'replace' option to do it seems not an ideal solution. Because it uses a global regex replace. If there are many replaces and the text is very long, considering it's not implement as an async function, it may freeze the node process. I'm planning to redesign and refactor the module in 2.0, will definitely include a language option.

@ogonkov
Copy link
Contributor

ogonkov commented Aug 7, 2018

I think it much better use something similar to moment dynamic locales load

https://github.com/moment/moment/blob/2e2a5b35439665d4b0200143d808a7c26d6cd30f/src/lib/locale/locales.js#L51-L59

I don't think that replacing/configuring languages is good idea, looks like project could do it, or maybe transliteration should have some callback/postprocessor, that could handle it transparently

@dzcpy dzcpy force-pushed the master branch 9 times, most recently from e32fa75 to 4b5107c Compare August 13, 2018 09:49
@dzcpy dzcpy force-pushed the master branch 3 times, most recently from 1753e2d to 97834a3 Compare January 11, 2019 14:14
@dzcpy
Copy link
Owner

dzcpy commented Jan 16, 2019

For a temporary solution, please check #56.
I'm considering adding this feature in V3 but I'm not sure if I have time working on it. Sorry guys.

@dzcpy dzcpy force-pushed the master branch 6 times, most recently from c52ceda to eae2688 Compare January 18, 2019 05:52
@dzcpy dzcpy force-pushed the master branch 3 times, most recently from cca6582 to 7aa485c Compare June 27, 2019 09:36
@sun sun mentioned this pull request May 5, 2020
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

Successfully merging this pull request may close these issues.

4 participants