anope

- supernets anope source code & configuration
git clone git://git.acid.vegas/anope.git
Log | Files | Refs | Archive | README

LANGUAGE (2669B)

      1 Anope Multi Language Support
      2 ----------------------------
      3 
      4 1) Building Anope with gettext support
      5 2) Adding a new language
      6 3) Using languages with modules
      7 
      8 1) Building Anope with gettext support
      9 
     10     To build Anope with gettext support, gettext and its development libraries must be installed on the system.
     11 
     12     On Debian install the locales-all package.
     13 
     14     On Ubuntu run locale-gen for each language you want to enable.
     15         For example:
     16         locale-gen es_ES.UTF-8
     17 
     18         Then execute:
     19         dpkg-reconfigure locales
     20 
     21     Building Anope on Windows with gettext support is explained in docs/WIN32.txt
     22 
     23 2) Adding a new language
     24 
     25     Anope uses gettext (https://www.gnu.org/software/gettext/) to translate messages for users. To add a new language
     26     install gettext and run `msginit -l language -o anope.language.po -i anope.pot`. For example if I was translating to
     27     Spanish I could run `msginit -l es_ES -o anope.es_ES.po -i anope.pot`. Open the newly generating .po file and start
     28     translating. Once you are done simply rerun ./Config; make && make install and add the language to your services.conf.
     29     Note that on Windows it is not quite this simple, windows.cpp must be edited and Anope recompiled and restarted.
     30 
     31     Poedit (https://poedit.net/) is a popular po file editor, and we recommend using it or another editor designed to edit
     32     po files (especially on Windows).
     33 
     34     If you have finished a language file translation and you want others to use it, please send it to team@anope.org
     35     (don't forget to mention clearly your (nick)name, your e-mail and the language name). You'll of course get full credit for it.
     36 
     37     NOTE: There is no guarantee we will use your work so please do not be offended if we say no thanks.
     38 
     39 3) Using languages with modules
     40 
     41     Module authors can easily add the ability to have their modules translated by adding _() around the strings they
     42     want translated (messages to the user, etc).
     43 
     44     If you want to translate a module someone has made, first generate a .pot file if there isn't one already using
     45     `xgettext -s -d modulename -o modulename.pot --from-code=utf-8 --keyword --keyword=_ modulename.cpp`.
     46     The .pot file is a template of all of the language strings extracted from the source file.
     47 
     48     Next, run msginit on the .pot file with
     49     `msginit -l language -o modulename.language.po -i modulename.pot`.
     50     Translate the new .po file and rerun ./Config; make && make install.
     51 
     52     All .po and .pot files should be placed in modules/third/language. Additionally an update script is provided there
     53     that will create .pot files and merge any changes to it with existing .po files.