开发者

Can someone break down how localization file ( .mo, .po ) generation works?

开发者 https://www.devze.com 2022-12-12 23:05 出处:网络
I\'m trying to grok gettext. Here\'s how I think it works - First you use some sort of po editor and tell it to scan a directory for your application, create these \".po\" files, the application mak

I'm trying to grok gettext.

Here's how I think it works -

First you use some sort of po editor and tell it to scan a directory for your application, create these ".po" files, the application makes a po file for each file scanned which contains a开发者_如何学运维 string in a programming language, then compile them to binary mo files, to which gettext parses, and you call a method using a high level API such as Zend_Translate and specify you want to use gettext, it can be setup to cache translations and it just returns those.

The part I'm really unclear about is how the editing of po files is done really, it's manual - right? Then when the compilation is done of course the application relies on the binary mo files.

And if someone could provide useful linux applications for editing .po files I'd be grateful.


The tutorial on NLS using GNU gettext should help you understand the process.

As for editing .po files, there's at least two applications (apart from vi :-): gtranslator and poedit.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号