# Don't allow super long words if there is a word length maximum

**URL:** <https://meta.discourse.org/t/dont-allow-super-long-words-if-there-is-a-word-length-maximum/44487>\
**Category:** Product Support\
**Created:** [19.Май.2016 09:54:58 UTC](https://meta.discourse.org/t/dont-allow-super-long-words-if-there-is-a-word-length-maximum/44487 "2016-05-19T09:54:58Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![helperhaps](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/helperhaps/32/59201_2.png) [@helperhaps](https://meta.discourse.org/u/helperhaps)\
**Post date:** [19.Май.2016 09:54:59 UTC](https://meta.discourse.org/t/dont-allow-super-long-words-if-there-is-a-word-length-maximum/44487/1 "2016-05-19T09:54:59Z")

</div>

I got an invalid title alert when i create a topic. DIg into the code i found it raised by TextSentinel class. And I have already read this [https://meta.discourse.org/t/are-very-long-words-not-allowed-in-topic-titles/29683/16](https://meta.discourse.org/t/are-very-long-words-not-allowed-in-topic-titles/29683/16). There is a related method in the class.

```plaintext
  def seems_unpretentious?
    # Don't allow super long words if there is a word length maximum
    @opts[:max_word_length].blank? || @text.split(/\s|\/|-|\./).map(&:size).max <= @opts[:max_word_length]
  end

```

I understand what it means. But for other language such as Chinese or Japanese whose word is not splited by blank or something about the patern.

Besides SiteSetting.title\_max\_word\_length’s value is 0 when i leave it blank in the setting panel, so the expression @opts[:max\_word\_length].blank? is always true. it is meaningless.

My users use Chinese more, So I have to set SiteSetting.title\_max\_word\_length as same value as SiteSetting.title\_max\_topic\_title\_length to make it work.

Is there some other way to solve it?

---

_[View the full topic](https://meta.discourse.org/t/dont-allow-super-long-words-if-there-is-a-word-length-maximum/44487)._
