Creating POT-Files

The build-up of any po- or pot-file

_____________________________________________________________________
#SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2002-04-06 21:44-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: gettext_example.php:21
msgid "Here comes the first string you want to have translated"
msgstr "In here you write the german/french translation"
msgid "This clause is in English"
msgstr "Dieser Satz ist auf deutsch"
_____________________________________________________________________

Difference between pot-file and po-file: pot-file are po-files which contain empty msgstr (msgstr "")

Setting up PoEdit to create POT-files

Use PoEdit (or something else)to create the template files and translations. You can get a copy from http://www.poedit.net/download.php. Available for Windows, Mac OS X and Linux.

Open the program. In "File\Preferences", change the PHP-Parser to use the following settings:

  • Language: PHP
  • List of extensions... : *.php;*.thtml;*.ctp
  • Parser command: xgettext --force-po -o %o %C %K %F --language=php
  • An item in the keywords list: -k%k
  • An item in input files list: %f
  • Sourcecode-Charset: --from-code=%c
Open the Catalog-Manager (File->Catalogmanager)
Create a new catalog, for example:
Project Name: "ScratchR"
Directories: C:\xampp\htdocs\scratchr\app\


In the column "Translation Memory" set the two values of "Configuration" to 0.

Close the Cataloguemanager and do "File->New Catalog"

"Project info": charset: utf-8

"Paths":

  • Base path: e.g. "C:\xampp\htdocs\scratchr\app\"
  •  Paths: (keep them up to date!)
    • views\administration
    • views\channel
    • views\contact
    • views\deleteme
    • views\dusers
    • views\dynpages
    • views\elements
    • views\errors
    • views\gallery
    • views\helpers
    • views\home
    • views\layouts
    • views\notifications
    • views\pages
    • views\projects
    • views\relationships
    • views\search
    • views\tags
    • views\themes (this one is actually obsolete)
    • views\users
    • controllers
    • config



"Keywords"
 Add: ___ (3x underscore) and __ (2x underscore for future CakePHP 1.2)

PoEdit will automatically search for the strings and create a file. Save the file as pot. This is your original copy. This file can be updated easily by clicking on "Catalog->Update from Sources". This is the copy you'll distribute to your translators.

The translators can create a default.po file from your template file and even update their old default.po with a new pot-file from your side.
Your translators should create mo-files as well. This function can be switched on in PoEdit in the menu "Preferences" (column "Editor").

Tag page
You must login to post a comment.