Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2017-02-08 04:19:00
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Textile: Open & close quotation marks for other language than English
I’m confused:
Why this changes in parser.php
(Textile) doesn’t work anymore ?
'quote_single_open' => '‹', // for Swiss German, original was ‘
'quote_single_close' => '›', // for Swiss German, original was ’
'quote_double_open' => '«', // for Swiss German, original was “
'quote_double_close' => '»', // for Swiss German, original was ”
Textile parses the standard German open and close quotation marks.
Last edited by GugUser (2017-02-08 20:19:55)
Offline
#2 2017-02-08 17:49:09
- ax
- Plugin Author
- From: Germany
- Registered: 2009-08-19
- Posts: 165
Re: Textile: Open & close quotation marks for other language than English
You can either try setting alternate glyphs or directly modify your classTextile.php. Yet another way is to produce quotation marks using CSS.
Good luck,
Peter
Offline
#3 2017-02-08 18:12:03
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: Textile: Open & close quotation marks for other language than English
The previous classTextile.php
in the current Textile (Textpattern 4.6.2) now is parser.php
. My example is from the lines 678-681. But it seams there is something that overrides my changes and I don’t know where ist this.
I don’t know how to interpret and apply this (lines 667-675):
/**
* Substitution symbols.
*
* Basic symbols used in textile glyph replacements. To override these, call
* setSymbol method before calling textileThis or textileRestricted.
*
* @var array
* @see Parser::setSymbol()
*/
In previous Textile Versions, my changes in the classTextile.php
had been implemented.
Offline
#4 2017-02-08 20:26:58
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: Textile: Open & close quotation marks for other language than English
It would be nice if parser.php
had a version number included. I don’t know which version I’m using (Textpattern 4.6. came with version 3.5, but it seems to me like I have a version 3.5.5).
Offline
#5 2017-02-09 13:21:49
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: Textile: Open & close quotation marks for other language than English
GugUser wrote #303883:
I’m confused:
Why this changes in
parser.php
(Textile) doesn’t work anymore ?
'quote_single_open' => '‹', // for Swiss German, original was ‘
'quote_single_close' => '›', // for Swiss German, original was ’
'quote_double_open' => '«', // for Swiss German, original was “
'quote_double_close' => '»', // for Swiss German, original was ”
Textile parses the standard German open and close quotation marks.
No one has an idea where this changes in the code are overridden?
Offline
#6 2017-02-09 13:26:59
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: Textile: Open & close quotation marks for other language than English
GugUser, have you tried without the comments? I’m not entirely sure where it applies but I’ve found comments inside some sort of code could stop it from working.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#7 2017-02-09 13:44:35
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: Textile: Open & close quotation marks for other language than English
uli wrote #303917:
GugUser, have you tried without the comments? I’m not entirely sure where it applies but I’ve found comments inside some sort of code could stop it from working.
No, it has no effect. The strange is that in the articles (body) Textpattern or Textile make German quotes, but in the titles, were I use the following code, make the Swiss quotes like «
= «.
<txp:smd_wrap transform='replace|regex|/"/|", textile'><h2><txp:title /></h2></txp:smd_wrap>
I have this problem only since the upgrade from Textpattern 4.5.7 to 4.6.2 and the chances I made in the current parser.php
. I don’t know if still exists a possibility to define the quotes in config.php
.
Last edited by GugUser (2017-02-09 13:50:50)
Offline
Re: Textile: Open & close quotation marks for other language than English
The strange is that in the articles (body) Textpattern or Textile make German quotes, but in the titles, were I use the following code, make the Swiss quotes like
«
= «.
That suggest to me that the live-rendered textile is working but the pre-rendered textile of the body is not.
Does it work if you create a brand new article? Does it work if you modify an existing article and re-save? If both work, txp is probably showing you the pre-rendered textile from the old version. You can see that if you check the rendered html output in the body_html
field in the database. This post has an old plugin that will reparse textile for the entire database (make a backup first).
There are some lines further down in parser.php
that also pertain to quotes, but they look like they already have German quotes in there, so I guess that wouldn’t need changing.
TXP Builders – finely-crafted code, design and txp
Offline
#9 2017-02-09 18:47:20
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: Textile: Open & close quotation marks for other language than English
jakob wrote #303919:
Does it work if you create a brand new article?
The same.
Does it work if you modify an existing article and re-save?
The same.
Etc.
I made several tests to answer your questions, but no one helped to clarify anything. Finally, I found out something that surprised me a lot.
Usually the backend admin language of the site is German, and the unwanted quotes since the upgrade were the German quotes (before the upgrade there were the Swiss quotes).
I changed the admin language to English, saved the article again, reloaded in the browser the page and the article showed the English quotes.
The same back again to the German admin language and the article showed the German quotes.
What is causing this? All my tests showed that Textile (or rather parser.php
) has no influence.
Offline
Re: Textile: Open & close quotation marks for other language than English
Interesting. Maybe the fairly new ability to switch the admin UI language independently of the public language (here I think) is causing the problem. It sounds like textile is using the admin language rather than the public-facing language settings.
TXP Builders – finely-crafted code, design and txp
Offline
#11 2017-02-09 20:45:32
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: Textile: Open & close quotation marks for other language than English
jakob wrote #303925:
Maybe the fairly new ability to switch the admin UI language independently of the public language (here I think) is causing the problem. It sounds like textile is using the admin language rather than the public-facing language settings.
But I’m using Textpattern 4.6.2 and in txp_lang.php
there is no line 45 'save_language_ui' => true,
etc.
Last edited by GugUser (2017-02-09 20:45:59)
Offline
#12 2017-02-10 02:40:58
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: Textile: Open & close quotation marks for other language than English
It seems to be so, the admin side language determines the type of quotes. I made tests with more languages and in French, for example, the quotes are the same as for Swiss German, but with a space between the quotes ant the first or the last letter.
I don’t like this. It should be possible to define the quotation marks independent of the language used in the backend.
Where are overwritten the Textile quotes definitions?
Offline