Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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 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
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
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
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
Re: Chinese error messages
pieman wrote:
I found
404_not_found
and410_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.
- Copy following code block below (it’s a textpack).
- Go to your Languages pane (Textpattern / Admin / Preferences / Language).
- Scroll down till you see the Textarea for installing Textpacks.
- Paste what you copied to it.
- Press the button below the field.
- 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
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
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
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
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
Pages: 1