Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-04-11 15:58:46

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Chinese error messages

I’m currently putting the finishing touches to a Chinese site.

The admin side should be English, but the front end in simplified Chinese.

I was about to make the error page then realised that the messages will be in English. What would be the best way to handle this?

The wiki says:

The error_message tag is a single tag that Textpattern will replace with the error message text for the error status as set by the server.

Is there an alternative to changing the server settings? Obviously I don’t want to get into manually writing Chinese error messages. (What’s Chinese for “I am a teapot” anyway?)

Offline

#2 2012-04-11 17:12:51

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Chinese error messages

The error_message tag uses Textpattern’s normal language strings, particularly 403_forbidden, 404_not_found and 500_internal_server_error.

You can just translate those strings to Chinese. And by translating I mean moving some signs from one place to other.

Offline

#3 2012-04-12 08:31:52

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: Chinese error messages

Thanks Jukka.

Jakob just pointed out that I could do the same with wet_babble, so I’ll try that.

Offline

#4 2012-04-12 09:01:26

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: Chinese error messages

OK, I’m a full newb at this, so forgive my total dumbness.

I found 404_not_found and 410_gone in the txp_lang table. Seems that txp_lang table maps onto the files in /textpattern/lang, correct? In which case I can apply those translations from zh-cn.txt using wet_babble.

But the other error messages I found – 403_forbidden, 404_not_found (again?) and 500_internal_server_error – live in publish.php and I’m not sure if there are any available Chinese language strings for those. So I’ll need to get them translated myself. Have I missed something?

Offline

#5 2012-04-12 10:53:53

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Chinese error messages

pieman wrote:

I found 404_not_found and 410_gone in the txp_lang table. Seems that txp_lang table maps onto the files in /textpattern/lang, correct?

Maps? No. The directory isn’t used after Textpattern has been installed, not for mapping or getting the translations. It has purpose as offline-distro for installing languages but that’s about it.

In which case I can apply those translations from zh-cn.txt using wet_babble.

Yes. You just copy the correct strings from zh-cn to the correct rows to the txp_lang table. And that’s it. Or I mean, you don’t need to do that either. Just use the textpack installer that is in Textpattern. In other words.

  1. Copy following code block below (it’s a textpack).
  2. Go to your Languages pane (Textpattern / Admin / Preferences / Language).
  3. Scroll down till you see the Textarea for installing Textpacks.
  4. Paste what you copied to it.
  5. Press the button below the field.
  6. Done. Eat some noddles, and drink some relaxing tea.
#@public
404_not_found => 您要找的网页不存在。
410_gone => 您要找的网页不存在。

404_not_found (again?)

Um, again? What are talking about exactly? Yes, sure you would find the string all around the source — the references live in the source files, referencing the translations. If by “again” you are referring to editing the core files, no. You don’t want to edit the source files, but translations.

and 500_internal_server_error – live in publish.php and I’m not sure if there are any available Chinese language strings for those. So I’ll need to get them translated myself. Have I missed something?

Yes, some language strings might be missing from some of the translations. Other than English, the translations might be outdated or incomplete. Chinese is latter.

As far as the error messages go, by default Textpattern generally only generates 404s. Others only appear when you specify them yourself. So, if you are not calling TXP’s password tag or txp_die, then you do not need even translate anything else than the 404 message.

Offline

#6 2012-04-12 13:26:06

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: Chinese error messages

Gocom wrote:

The directory […] has purpose as offline-distro for installing languages but that’s about it.

Ok, thanks. I didn’t know how it was used.

In which case I can apply those translations from zh-cn.txt using wet_babble.

Yes. You just copy the correct strings from zh-cn to the correct rows to the txp_lang table. And that’s it. Or I mean, you don’t need to do that either. Just use the textpack installer that is in Textpattern.

If by “again” you are referring to editing the core files, no. You don’t want to edit the source files, but translations.

That’s just me trying to explain that I found 404_not_found both in the txp_lang table and in publish.php. Not that I was going to actually hack publish.php… it was just an observation, honest guv.

Thanks for the general advice Jukka – much appreciated. Textpack installed :-)

Offline

#7 2012-04-12 14:00:29

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,001
Website GitHub

Re: Chinese error messages

Just a quick question: Do own versions of text strings you add via the Textpack field at the bottom of prefs > languages persist when that language is updated later? Or do they get overwritten?


TXP Builders – finely-crafted code, design and txp

Offline

#8 2012-04-12 17:40:16

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Chinese error messages

jakob wrote:

Just a quick question: Do own versions of text strings you add via the Textpack field at the bottom of prefs > languages persist when that language is updated later? Or do they get overwritten?

No, they do not persist. Using textpacks and language update links both overwrite all language strings the installed file defines. If you ever find yourself updating the language, after updating you would just run the Textpack again, which re-does the modifications.

Offline

#9 2012-04-12 21:53:51

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,001
Website GitHub

Re: Chinese error messages

Thanks for the info – that’s what I had assumed. So, there is still a use for wet_babble for people not good at remembering to reapply the textpack.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB