User Tools

Site Tools


doc:lang:packs:guidelines

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
doc:lang:packs:guidelines [2019/06/06 18:12]
arvid [Shell Script]
doc:lang:packs:guidelines [2020/04/15 13:30]
arvid
Line 1: Line 1:
-====== ​Lang Pack Guidelines ​======+====== ​Language pack guidelines ​======
  
 +Thanks for translating FlatPress to your language! Before taking this effort, please check on our [[res:​language|language page]] if such a translation pack already exists.
 +
 +==== Technical details ====
 Language files should be encoded in **UTF-8 (without BOM)**. 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 bundled with Flatpress 0.804.1 Vivace ===== 
- 
-Here's a sample coming from the en-us package which is bundled in Flatpress 0.804.1 Vivace (you can use the shell script on this page; a php script should be coming soon): 
-<​code>​ 
-. 
-|-- fp-interface 
-|   `-- lang 
-|       `-- en-us 
-|           |-- 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.themes.php 
-|           |-- lang.admin.uploader.php 
-|           |-- lang.admin.widgets.php 
-|           |-- lang.comments.php 
-|           |-- lang.conf.php 
-|           |-- lang.contact.php 
-|           `-- lang.default.php 
-|-- fp-plugins 
-|   |-- accessibleantispam 
-|   ​| ​  `-- lang 
-|   ​| ​      `-- lang.en-us.php 
-|   |-- adminarea 
-|   ​| ​  `-- lang 
-|   ​| ​      `-- lang.en-us.php 
-|   |-- akismet 
-|   ​| ​  `-- lang 
-|   ​| ​      `-- lang.en-us.php 
-|   |-- archives 
-|   ​| ​  `-- lang 
-|   ​| ​      `-- lang.en-us.php 
-|   |-- blockparser 
-|   ​| ​  `-- lang 
-|   ​| ​      `-- lang.en-us.php 
-|   |-- calendar 
-|   ​| ​  `-- lang 
-|   ​| ​      `-- lang.en-us.php 
-|   |-- categories 
-|   ​| ​  `-- lang 
-|   ​| ​      `-- lang.en-us.php 
-|   |-- lastcomments 
-|   ​| ​  `-- lang 
-|   ​| ​      `-- lang.en-us.php 
-|   |-- lastentries 
-|   ​| ​  `-- lang 
-|   ​| ​      `-- lang.en-us.php 
-|   |-- lightbox 
-|   ​| ​  `-- lang 
-|   ​| ​      `-- lang.en-us.php 
-|   |-- prettyurls 
-|   ​| ​  `-- lang 
-|   ​| ​      `-- lang.en-us.php 
-|   `-- thumb 
-|       `-- lang 
-|           `-- lang.en-us.php 
-`-- fp-setup 
-    `-- lang 
-        `-- lang.en-us.php 
-</​code>​ 
- 
- 
- 
- 
- 
- 
-===== 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 
- 
-<code bash> 
-#!/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 
-</​code>​ 
- 
-this Batch file creates a LANGPACK directory, you'll have to zip it yourself :) 
- 
-<code batch> 
-@echo off 
- 
-setlocal ENABLEDELAYEDEXPANSION 
- 
-set ROOT=%CD% 
-set CURRENT=%CD%\flatpress 
-set LANG=%1 
-set DEST=%ROOT%\LANGPACK 
- 
-if "​%LANG%"​==""​ GOTO USAGE 
-if not exist %CURRENT%\index.php GOTO USAGE 
- 
-rmdir /s /q %DEST% > NUL 
-mkdir %DEST%\fp-interface\lang > NUL 
- 
-echo COPYING MAIN LANG FILES 
-mkdir %DEST%\fp-interface\lang\%LANG% > NUL 
-copy %CURRENT%\fp-interface\lang\%LANG%\ %DEST%\fp-interface\lang\%LANG% > NUL 
-echo DONE 
- 
-mkdir %DEST%\fp-plugins\ 
-echo COPYING PLUGIN LANG FILES 
-for /d %%A in (%CURRENT%\fp-plugins\*) do ( 
- if exist %%A ( 
- set THEFILE=%%~nxA 
- echo !THEFILE! 
- set THEDIR=%DEST%\fp-plugins\!THEFILE!\lang\ 
- mkdir !THEDIR! > NUL 
- copy %CURRENT%\fp-plugins\!THEFILE!\lang\lang.%LANG%.php !THEDIR! > NUL 
- ) 
-) 
-echo DONE 
- 
-GOTO EOF 
  
  
-:USAGE +==== Which files to translate? ====
-echo USAGE: makelangpack LANG +
-echo Where LANG is a locale, as in en-us, it-it, de-de, etc.+
  
-:EOF+  - Core language filesEverything under fp-interface/​lang/​ (and then your language code). Best practice is to copy the en-us folder and then translate file by file. 
 +  - Plugin language files: All files in fp-plugins/​[name of the plugin]/​lang/​.
  
 +==== How to publish? ====
 +A language pack should partially reproduce the FlatPress directory structure. Goal is to have a ZIP file one can simply extract into their FlatPress folder.
  
-</code>+Please publish your language pack on the [[res:​language|language page]]. If you have any suggestions or need help creating your language pack, please visit the [[https://​forum.flatpress.org|support forum]].
doc/lang/packs/guidelines.txt · Last modified: 2020/04/30 11:46 by eagleman