简体   繁体   中英

PHP gettext shared server locale - another translation method?

After some 3 hours trying to make gettext work I noticed it doesn't worked all this time because my system does not recognize pt_BR locale so I installed it (Ubuntu) (Also, I needed to use pt_BR.utf8 ) now I was thinking a bit and what is going to happen if my website has a translation not supported by current Host/Shared Host? Everything translated will be useless? or someone in here is going to answer:

You need to contact they to install the locale you want

Too obvious huh... There are some another away to translate a website easy like gettext where is not going to be messed by locales ? (Use locale -a If you want to see your locales.)

Instead of using gettext, and as long as you're using unicode, you could try some other approach - I use xml and a little library I wrote - you can try it out here:

http://flarework.com/static/i18n/?lang=jp

Parsing your gettext and converting to the XML format used by the library should be pretty straightforward. The benefit of using strings stored in XML is that it's much, much easier to update than compiled gettext, which depending on the scale of your project might work out well for you. It's also totally independent of any server settings, which makes life easier.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM