Title: Regarding the word count problem
Author: Jiehan Zheng
Published: October 15, 2011

---

 [  ](https://profiles.wordpress.org/jiehanzheng/) [Jiehan Zheng](https://profiles.wordpress.org/jiehanzheng/)
5:41 pm _on_ October 15, 2011     
Tags: [request ( 1,481 )](https://make.wordpress.org/polyglots/tag/request/),
[svn ( 49 )](https://make.wordpress.org/polyglots/tag/svn/), [zh_CN ( 542 )](https://make.wordpress.org/polyglots/teams/?locale=zh_CN)

# Regarding the word count problem

Hi there.

The current JavaScriptJavaScript JavaScript or JS is an object-oriented computer
programming language commonly used to create interactive effects within web browsers.
WordPress makes extensive use of JS for a better user experience. While PHP is executed
on the server, JS executes within a user’s browser. [https://www.javascript.com](https://www.javascript.com/)
code for counting words in editor ignores Chinese characters, so I am working on
a patch which I intend to ship with future cn.wordpress.orgWordPress.org The community
site where WordPress code is created and shared by the users. This is where you 
can download the source code for WordPress core, plugins and themes as well as the
central location for community conversations and organization. [https://wordpress.org/](https://wordpress.org/)
packages.

It seems that the easiest fix is to enqueue a modified `wp-admin/js/word-count.js`.
Is it okay to put a modified version under the corresponding SVNSVN Apache Subversion(
often abbreviated SVN, after its command name svn) is a software versioning and 
revision control system. Software developers use Subversion to maintain current 
and historical versions of files such as source code, web pages, and documentation.
Its goal is to be a mostly compatible successor to the widely used Concurrent Versions
System (CVS). WordPress core and the wordpress.org released code are all centrally
managed through SVN. https://subversion.apache.org/. `dist/` directory, and get 
the original `word-count.js` replaced, OR I have to put it under `wp-content/languages/`
and play around with the hook to make it be queued to load?

Thank you.

[#request](https://make.wordpress.org/polyglots/tag/request/), [#svn](https://make.wordpress.org/polyglots/tag/svn/),
[#zh_cn](https://make.wordpress.org/polyglots/teams/?locale=zh_CN)

### Share this:

 * [  Threads ](https://make.wordpress.org/polyglots/2011/10/15/regarding-the-word-count-problem/?share=threads)
 * [  Bluesky ](https://make.wordpress.org/polyglots/2011/10/15/regarding-the-word-count-problem/?share=bluesky)
 * [  Facebook ](https://make.wordpress.org/polyglots/2011/10/15/regarding-the-word-count-problem/?share=facebook)
 * [  X ](https://make.wordpress.org/polyglots/2011/10/15/regarding-the-word-count-problem/?share=x)
 * [  Mastodon ](https://make.wordpress.org/polyglots/2011/10/15/regarding-the-word-count-problem/?share=mastodon)
 * [  WhatsApp ](https://make.wordpress.org/polyglots/2011/10/15/regarding-the-word-count-problem/?share=jetpack-whatsapp)
 * [  LinkedIn ](https://make.wordpress.org/polyglots/2011/10/15/regarding-the-word-count-problem/?share=linkedin)

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fpolyglots%2F2011%2F10%2F15%2Fregarding-the-word-count-problem%2F%23respond&locale=en_US)

 * [To-do](https://make.wordpress.org/polyglots/2011/10/15/regarding-the-word-count-problem/?output_format=md#)

 1. ![](https://secure.gravatar.com/avatar/d71843bd2670ce03308e7ab56b82febe090a6cfb9944e81657bd619a4756d50f?
    s=32&d=mm&r=g)
 2.  [Zé](http://everywhereelse.wordpress.com)  11:10 pm _on_ October 16, 2011
 3. Conceptually, I’d argue that the first option (replacing the original word-count.
    js) is changing coreCore Core is the set of software required to run WordPress.
    The Core Development Team builds WordPress. code, and hence recommend against it.
    That said, it also depends on what you mean by “play around with the hook to make
    it be queued to load”. Completely personal and subjective opinion, of course, would
    love to hear more from the others.
 4.  * ![](https://secure.gravatar.com/avatar/a65f734aa3961c5089f6dba21b3ce64362b3e6681e607ff55cc08fd91763edd9?
       s=32&d=mm&r=g)
     *  [jiehanzheng](http://jiehan.org)  11:43 pm _on_ October 16, 2011
     * Okay then the first option is out. The real issue is that the built-in word 
       counting function is not working for Chinese characters. By “play around with
       the hook to make it be queued to load” I mean I intend to include a `zh_CN-word-
       count.js` or something else and add a few lines of codeLines of Code Lines of
       code. This is sometimes used as a poor metric for developer productivity, but
       can also have other uses. in `zh_CN.php` to make it be loaded and deregister
       the original `word-count.js` so that the original coreCore Core is the set of
       software required to run WordPress. The Core Development Team builds WordPress.
       code remains intact and we can make the word counting work when WPLANG is defined
       as zh_CN in `wp-config.php`.
        - ![](https://secure.gravatar.com/avatar/d71843bd2670ce03308e7ab56b82febe090a6cfb9944e81657bd619a4756d50f?
          s=32&d=mm&r=g)
        -  [Zé](http://everywhereelse.wordpress.com)  12:00 am _on_ October 17, 2011
        - This sounds very good, on the other hand 🙂
 5. ![](https://secure.gravatar.com/avatar/aa89edf971372c035a02c633667412facd8b00fd6946fe4f208f7aed7f7bb524?
    s=32&d=mm&r=g)
 6.  [Naoko](http://ja.blog.wordpress.com/)  1:25 am _on_ October 17, 2011
 7. Japanese package includes a fix for this as a pluginPlugin A plugin is a piece 
    of software containing a group of functions that can be added to a WordPress website.
    They can extend functionality or add new features to your WordPress websites. WordPress
    plugins are written in the PHP programming language and integrate seamlessly with
    WordPress. These can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
    or can be cost-based plugin from a third-party.:
     [https://wordpress.org/extend/plugins/wp-multibyte-patch/](https://wordpress.org/extend/plugins/wp-multibyte-patch/)
    If you’re interested, I’d be happy to help the author translate the whole thing
    but here’s Google translated version of the description page: [http://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Feastcoder.com%2Fcode%2Fwp-multibyte-patch%2F](http://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Feastcoder.com%2Fcode%2Fwp-multibyte-patch%2F)
 8.  * ![](https://secure.gravatar.com/avatar/6a5f2e886fa8d86875afe84838cf0e17ec5a52f233b40ccbe5c0dd0eff3ae3f7?
       s=32&d=mm&r=g)
     *  [Nikolay Bachiyski](http://nikolay.bg/)  3:32 pm _on_ October 17, 2011
     * [@jiehanzheng](https://profiles.wordpress.org/jiehanzheng/), I would recommend
       you do what the Japanese guys did. It’s working great.
        - ![](https://secure.gravatar.com/avatar/a65f734aa3961c5089f6dba21b3ce64362b3e6681e607ff55cc08fd91763edd9?
          s=32&d=mm&r=g)
        -  [jiehanzheng](http://jiehan.org)  8:13 pm _on_ October 17, 2011
        - Cool. Thank you for your advice. So for the pluginPlugin A plugin is a piece
          of software containing a group of functions that can be added to a WordPress
          website. They can extend functionality or add new features to your WordPress
          websites. WordPress plugins are written in the PHP programming language and
          integrate seamlessly with WordPress. These can be free in the WordPress.org
          Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
          or can be cost-based plugin from a third-party. solution, am i supposed to
          include a copy of the plugin under SVNSVN Apache Subversion (often abbreviated
          SVN, after its command name svn) is a software versioning and revision control
          system. Software developers use Subversion to maintain current and historical
          versions of files such as source code, web pages, and documentation. Its 
          goal is to be a mostly compatible successor to the widely used Concurrent
          Versions System (CVS). WordPress core and the wordpress.org released code
          are all centrally managed through SVN. https://subversion.apache.org/. `dist/
          wp-content/plugins/`? Who should be the plugin author, and may I have a WordPress.
          orgWordPress.org The community site where WordPress code is created and shared
          by the users. This is where you can download the source code for WordPress
          core, plugins and themes as well as the central location for community conversations
          and organization. [https://wordpress.org/](https://wordpress.org/) account
          with the name `wordpresschina`?
        - I will look into it, see how it works during the upcoming school long weekend
          and hopefully include the fix before our next release. I will post any updates
          here.
     * ![](https://secure.gravatar.com/avatar/a65f734aa3961c5089f6dba21b3ce64362b3e6681e607ff55cc08fd91763edd9?
       s=32&d=mm&r=g)
     *  [jiehanzheng](http://jiehan.org)  8:14 pm _on_ October 17, 2011
     * Thank you so much, Naoko. It’s a pretty nice idea because of the similarities
       of Japanese characters and Chinese characters. I will look into it.
     * The Google Translate version is… to some extend, readable. So thank you for 
       your offer and I will do the research.

### Leave a Reply 󠀁[Cancel reply](https://make.wordpress.org/polyglots/2011/10/15/regarding-the-word-count-problem/?output_format=md#respond)󠁿

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fpolyglots%2F2011%2F10%2F15%2Fregarding-the-word-count-problem%2F&locale=en_US)
to post a comment.

# Post navigation

[← Hello Translation for Twenty Eleven isn’t included in…](https://make.wordpress.org/polyglots/2011/10/15/hello-translation-for-twenty-eleven-isnt-included-in/)

[Hi all I’m requesting subdomain for the Icelandic… →](https://make.wordpress.org/polyglots/2011/10/15/hi-all-im-requesting-subdomain-for-the-icelandic/)