Lang Pack Guidelines

Language files should be encoded in UTF-8 (without BOM).

A lang pack should partially reproduce the fp directory structure, so that the contents of the decompressed archive can be safely dropped into the flatpress installation dir

Sample layout

Here's a sample coming from the it-it package (you can use the shell script on this page; a php script should be coming soon):

.
|-- fp-interface
|   `-- lang
|       `-- it-it
|           |-- id
|           |-- lang.admin.config.php
|           |-- lang.admin.entry.php
|           |-- lang.admin.main.php
|           |-- lang.admin.maintain.php
|           |-- lang.admin.php
|           |-- lang.admin.plugin.php
|           |-- lang.admin.static.php
|           |-- lang.admin.uploader.php
|           |-- lang.admin.widgets.php
|           |-- lang.conf.php
|           |-- lang.contact.php
|           |-- lang.date.php
|           |-- lang.default.php
|           |-- lang.php
|           `-- lang_gui.php
`-- fp-plugins
    |-- accessibleantispam
    |   `-- lang
    |       `-- lang.it-it.php
    |-- adminarea
    |   `-- lang
    |       `-- lang.it-it.php
    |-- akismet
    |   `-- lang
    |       `-- lang.it-it.php
    |-- archives
    |   `-- lang
    |       `-- lang.it-it.php
    |-- calendar
    |   `-- lang
    |       `-- lang.it-it.php
    |-- categories
    |   `-- lang
    |       `-- lang.it-it.php
    |-- lastcomments
    |   `-- lang
    |       `-- lang.it-it.php
    |-- lastentries
    |   `-- lang
    |       `-- lang.it-it.php
    |-- lightbox
    |   `-- lang
    |       `-- lang.it-it.php
    |-- prettyurls
    |   `-- lang
    |       `-- lang.it-it.php
    `-- thumb
        `-- lang
            `-- lang.it-it.php

Shell Script

Usage: ./makelangpack LOCALE

where 'LOCALE' is the locale id of the target language (it-it, en-us, de-de… etc)

put this script in the same dir where you have flatpress/

this script will create a lang/ dir with all of the language files; the script will attempt to create a fp-lang-$LOCALE.tar.bz2 file, you can anyway zip or tar the lang/ dir on your own.

PS: I know, this code sucks :D ~~NWM

#!/bin/sh
 
ROOT=`pwd`
CURRENT=$ROOT/flatpress
LANG=$1
DEST=$ROOT/lang
 
if [ -z $LANG ]; then 
        echo USAGE: makelangpack LANG
        echo Where LANG is a locale, as in en-us, it-it, de-de etc.
fi
 
rm -Rf $DEST
mkdir -p $DEST/fp-interface/lang 
 
echo COPYING MAIN LANG FILES
cp -Rf $CURRENT/fp-interface/lang/$LANG/ $DEST/fp-interface/lang/
echo DONE
 
mkdir $DEST/fp-plugins/
echo COPYING PLUGIN LANG FILES
for A in $CURRENT/fp-plugins/* ; do
        if [ -e $A/lang/ ] ; then
                THEFILE=`basename $A`
                echo  $THEFILE : COPYING LANG FILE
                THEDIR=$DEST/fp-plugins/$THEFILE/lang/
                mkdir -p $THEDIR
                cp $CURRENT/fp-plugins/$THEFILE/lang/lang.$LANG.php $THEDIR
        fi
done
echo
 
echo CREATING PACKAGE
 
tar cjf fp-lang-$LANG.tar.bz2 $DEST
 
echo LANG files for $LANG are in $DEST
 
doc/lang/packs/guidelines.txt · Last modified: 2008/06/15 12:01 by marcoverga
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki