Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-06-11 12:25:46

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,149
Website

pat_hyphenate

pat_hyphenate

A Textpattern CMS plugin for typography lovers & exigent designers that automatic makes hyphenation in web page contents using soft hyphens.

Purpose

The texts on the web suffer from aestetic diffe­rences (blank space’s widths) bet­ween each words when they are justi­fied or too large differences in lenght of lines when they are left aligned. Maybe it’s the reason why the CSS “text-justify;” pro­perty isn’t used often. The only (poor) solu­tion was to use the sign ­ (utf-8 encoding hyphen) which has a big pro­blem: the text be­come often un­readable for the copy writers. This plugin makes auto­ma­tic hyphe­nation in web text content using soft hy­phens. Your web pages will be as beauti­ful as magazine prin­tings.
Supp­orts the pecu­lia­rities of different languages (actually 19).


Image: pat_hyphenate: Personal Dictionary page in order to use addi­tional hy­phens or over­­write inter­nal rules.

Installation

Uncompress the file. Put the _hyphenator directory, and all its content, into your /textpattern directory. Be sure to give write acc­ess to the /textpattern/_hyphenator directory (CHMOD 775 or CHMOD 777).

Usage

<txp:pat_hyphenate content="" lang="" />

Attributes

  • content (required): choose which text content to hyphenate.
    Only 2 available options: body or excerpt.
    If unsets, displays a war­ning message. Default: body
  • lang (optional): sets the content language in four letters form (i.e. en-us). Default: Textpattern’s back-office language.
    Useful for multi­lingual websites with event­ually the help of a <txp:variable /> tag.
    In that only case, replace the double quotes surround­ing your variable into the lang attribute with simple quotes.
    Notice: if your text content has some <code> or <pre> tags in it, the hyphenation doesn’t occur and the text is shown by the native <txp:body /> or <txp:excerpt /> tags.

Example

Using in remplacement of the native <txp:body /> tag:

<txp:pat_hyphenate content="body" lang="en" />

which automaticaly add hyphens on all words for your body articles wrote in English accor­dingly with the lingual rules.

Personal dictionary

Due to the language complexity, for some words the hyp­hens are not displayed. You have a Per­sonal dic­tiona­ry (located under the “Content” tab) in order to add your per­sonal rules. The words (one word by lines) you write here must have an hyphen (-) where you want to add an… hyphen ;). The “Personal Dictionary” is reactive: if you change your back-office language, a corres­ponding dictio­nary language is loaded. So, multi­lingual websites get benefits with this feature. All dictionary files are created if they don’t exist.

Languages support:

  • bn
  • de
  • en
  • es
  • fi
  • fr
  • gu
  • hi
  • it
  • ka
  • ml
  • nl
  • or
  • pa
  • pl
  • ru
  • sv
  • ta
  • tev

Plugin’s options (admins access only)

Visit the pat_hyphenate Options (under the “Extensions” tab) to install your Text­pack plugin trans­lation langua­ge file or to install upgrades.

Plugin’s Preferences (scheduled in next version. Note: current users will have free unlimited upgrades)

Access to Plugin’s Prefs in order to:

Set your PayPal Transaction ID your receive when you bought this plugin. Nee­ded if you want to grab all the future plugin up­grades if available (unlimited time offer).

Typographic configurations:

Set the character remplacement used for hyphens. Default and best choice: &shy;
Minimum characters on the left: characters to keep before an hyphen.
Minimum characters on the right: characters to keep after an hyphen.
Minimum characters: when to apply hyphens.
Maximum characters: when to stop hyphens.

Changelog

  • 4th December 2013: v 0.2.8 validates lang & codes to exclude atributes.
  • 3rd December 2013: v 0.2.7 validates (some) integer attributes.
  • 1st December 2013: v 0.2.6 final.
  • 26th November 2013: v 0.2.5. Multilingual support.
  • 31st August 2013: v 0.2.4. Add plugin’s prefs support.
  • 14th May 2013: v 0.2.3. public version.
  • 12th May 2013: v 0.2.2.a Add creation on the fly feature for the dictionary-$lang.txt file.
  • 9th May 2013: v 0.2.2. Add a Textpack support. Add an upgrade feature for the plugin.
  • 8th may 2013: v 0.2.1. Add tests on <code> & <pre> tags. Thanks for notice CEBE.
  • 7th may 2013: v 0.2. Personal dictionary box added in the TXP back-office.
  • 5th may 2013: v 0.1 first commit with only front usage.

Credits

Thanks to Core Dev Team who makes Textpattern CMS so awesome.
Thanks to the creators of the Hyphenator library.
Many thanks to (one of my prefered TXP plugin programer) CEBE for her good advices.

Get it

Access to the pat_hyphenate plugin website

Last edited by Pat64 (2013-12-04 16:16:45)


Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
Github

Offline

#2 2013-06-21 07:10:27

Kri.o
Member
Registered: 2013-01-16
Posts: 22
Website

Re: pat_hyphenate

Patrick, thank you! That’s what I was looking for a long time…

Thanks again.

Offline

#3 2013-06-21 07:20:32

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,149
Website

Re: pat_hyphenate

:)

With my pleasure.


Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
Github

Offline

#4 2013-06-24 11:16:54

Kri.o
Member
Registered: 2013-01-16
Posts: 22
Website

Re: pat_hyphenate

Don’t work with russian language.

What’s wrong?

upd.
I continue to hyphenate manually…

Last edited by Kri.o (2013-06-24 11:43:38)

Offline

#5 2013-06-24 13:26:57

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,149
Website

Re: pat_hyphenate

Hi Krio.

Could you send me your text in Russian, please (pretty difficult for me to write with this language ;) ?

Just a question: did you install the russian language for Textpattern CMS back-office?

Edit: lang attribute need four letters (due to TXP back-office language option). So try this:

<txp:pat_hyphenate content="body" lang="ru-ru" />

Tips: if all works fine after that, remove all your manual hyphen signs in your texts: you never need it.

Last edited by Pat64 (2013-06-24 13:43:02)


Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
Github

Offline

#6 2013-06-25 05:06:37

Kri.o
Member
Registered: 2013-01-16
Posts: 22
Website

Re: pat_hyphenate

lang="ru-ru" doesn’t work, I have tried this.

I have already installed russian back-office language, as well as english. No change…

That’s my text in russian:

Долгожданное обновление портфолио компании. Уютная кухня в розовых тонах и витрина оригинальной формы.

Компания открывает производство элитной мебели в Туле: кухонные гарнитуры из натурального дерева!

Восточные мотивы на сайте “Вашего Мебельера”: cтенка для гостиной и шкаф-купе в наборе мебели “Махаон”.

Новые шкафы для небольшой спальни и стандартной прихожей: “Нега” и “Отражение”.

Обновление раздела “Портфолио”: торговое оборудование для наших партнёров, компании “Биосфера”.

Новые фотографии в рубрике “Торговая мебель”, комплект мебели для офиса: стойка “Консул”, витрина “Базилевс”, шкафы “Кардинал”.

Last edited by Kri.o (2013-06-25 05:08:18)

Offline

#7 2013-06-25 07:29:47

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,149
Website

Re: pat_hyphenate

Ok. Thanks Kri.

I’ll make some tests today and come back later.


Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
Github

Offline

#8 2013-07-08 04:44:17

Kri.o
Member
Registered: 2013-01-16
Posts: 22
Website

Re: pat_hyphenate

Is there any progress?

Offline

#9 2013-07-08 07:46:16

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,149
Website

Re: pat_hyphenate

Hi Kri.

I’d played with Russian language lot with some difficulties…
Stay tuned.


Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
Github

Offline

#10 2013-07-08 10:17:36

Kri.o
Member
Registered: 2013-01-16
Posts: 22
Website

Re: pat_hyphenate

Ok, Patrick.

I’m waiting…

Offline

Board footer

Powered by FluxBB