Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2017-02-10 04:35:22
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: Textile: Open & close quotation marks for other language than English
I find it for the current Textpattern version 4.6.2.
It’s in textpattern/vendors/Textpattern/Textile/Parser.php
from line 47:
public function __construct($doctype = null)
{
if ($doctype === null) {
$doctype = get_pref('doctype', 'html5');
}
parent::__construct($doctype);
$this->setRelativeImagePrefix(hu);
$this->setSymbol('quote_single_open', gTxt('txt_quote_single_open'));
$this->setSymbol('quote_single_close', gTxt('txt_quote_single_close'));
$this->setSymbol('quote_double_open', gTxt('txt_quote_double_open'));
$this->setSymbol('quote_double_close', gTxt('txt_quote_double_close'));
}
What’s the idea behind this? If, for example, the articles are in German, but the writer prefers a backend in Spanish, then the rendered article in the browser shows the wrong quotes. Was there a discussion about this? I can’t remember.
Offline
#14 2017-02-10 04:51:57
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: Textile: Open & close quotation marks for other language than English
So I changed this lines, and now the wanted quotes are rendered:
$this->setSymbol('quote_single_open', '‹');
$this->setSymbol('quote_single_close', '›');
$this->setSymbol('quote_double_open', '«');
$this->setSymbol('quote_double_close', '»');
But it’s never an good idea to change the core files.
Offline
Re: Textile: Open & close quotation marks for other language than English
GugUser wrote #303929:
the admin side language determines the type of quotes… What’s the idea behind this?
It’s always been that way. Textile is applied at the point you save an article. So it stands to reason that the admin-side language in use determines the ‘language features’ that Textile employs.
In prior versions of Textile, the quotes were static so nobody had any control over them. The change was made — at the Textile level at least — for greater convenience in defining per-language markup rules. Unfortunately for Textpattern, that means there’ll be issues such as those you highlight, until we can factor in the notion of a ‘language’ for each article. It’s on the plan. Just not yet.
If you want to alter it now without hacking core (uhh, sort of) you can redefine the four entries:
txt_quote_single_open
txt_quote_single_close
txt_quote_double_open
txt_quote_double_close
in your txp_lang table for all language(s) that you have installed. The only thing that currently uses those strings is Textile. But if you update your language strings from the server, they’ll get overwritten.
Last edited by Bloke (2017-02-10 09:05:39)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online