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

Bug with Arabic language. #7

Closed
ivan-nginx opened this issue Aug 14, 2017 · 9 comments
Closed

Bug with Arabic language. #7

ivan-nginx opened this issue Aug 14, 2017 · 9 comments
Assignees

Comments

@ivan-nginx
Copy link

  1. Go on test post.
  2. See Words count in article: 10 in meta. There are more then 10 words in this article, i think.
  3. See other articles on this site — other posts in normal counting state.

So, bug with RTL language counting.

@willin
Copy link
Owner

willin commented Aug 14, 2017

https://github.com/willin/hexo-wordcount/blob/master/index.js#L11-L12

currently it can only counts chinese/english words.

notice that L11:

var cn = content.match(/[\u4E00-\u9FA5]/g) || [];

means chinese words unicode range. you can change it into arabic language range.

@ivan-nginx
Copy link
Author

ivan-nginx commented Aug 14, 2017

@willin but Russian words counting too. They also have another unicode instead of Chinese, isn't it?


Oooh, i see. U added filter in function and only CN and EN will work with your latest plugin version?

@willin
Copy link
Owner

willin commented Aug 14, 2017

yes.

yes.

@ivan-nginx
Copy link
Author

Ok, i got it. Bad. Very bad and sad. Need to do for international support, not only for some countries.

@willin
Copy link
Owner

willin commented Aug 14, 2017

as you wish, i will support asap

@willin
Copy link
Owner

willin commented Aug 14, 2017

@ivan-nginx do me a favor

كل فمرّ وانتهاءً حين. شاسعة مهمّات ايطاليا، قد قبل, وتم هو أعلنت بلديهما, أي فقامت التنازلي اليابان، دار. ثم ضمنها الإمتعاض بريطانيا-فرنسا على, قد حول وقرى استدعى. أوروبا ألمانيا ٣٠ يبق. عرض إذ احداث الصين. في بين ببعض ويكيبيديا،, وصل بسبب تحرير النفط بـ. 

is it 44 words ( 212 chars )?

ckeditor wordcount: http://w8tcha.github.io/CKEditor-WordCount-Plugin/

@ivan-nginx
Copy link
Author

ivan-nginx commented Aug 14, 2017

@willin i don't know Arabic language, it seems like something about 40 words, yep. But not 10 words anyway, u agree?
I repeat: for now on my test site version WC 2.x installed (without CN/EN filtering) and RU lang work fine. Only RTL for now not working as we see.

RU/EN/CN have LTR language direction, instead of Arabic language, wich have RTL direction. I added RTL direction feature in last pull (PART 4) before release 5.1.2 NexT version.

BTW, your wordcount plugin was integrated in NexT (PART 3) by me too, so, i don't understand why u try to isolate plugin in CN/EN language filters. NexT support many languages, Hexo support i18n. And your integrated plugin already translated in NexT, but u adding filter only on some languages. I think, this is not right to great coding. And i believe on your correction about freedom of choice.

@willin
Copy link
Owner

willin commented Aug 14, 2017

i see

i will try to look deep into this issue before weekend

@willin willin self-assigned this Aug 15, 2017
willin added a commit that referenced this issue Aug 15, 2017
@willin
Copy link
Owner

willin commented Aug 15, 2017

try beta version

Count Words

countwords(post.content)

Count Chars

countchars(post.content)

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