doc:lang:packs:guidelines
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:lang:packs:guidelines [2019/06/06 18:12] – [Shell Script] arvid | doc:lang:packs:guidelines [2023/11/24 19:05] (current) – Added GitHub fork possibility arvid | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | Thanks for translating FlatPress to your language! Before taking this effort, please check on our [[res: | ||
+ | |||
+ | ==== 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): | ||
- | < | ||
- | . | ||
- | |-- 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 | ||
- | | | ||
- | | | ||
- | | |-- adminarea | ||
- | | | ||
- | | | ||
- | | |-- akismet | ||
- | | | ||
- | | | ||
- | | |-- archives | ||
- | | | ||
- | | | ||
- | | |-- blockparser | ||
- | | | ||
- | | | ||
- | | |-- calendar | ||
- | | | ||
- | | | ||
- | | |-- categories | ||
- | | | ||
- | | | ||
- | | |-- lastcomments | ||
- | | | ||
- | | | ||
- | | |-- lastentries | ||
- | | | ||
- | | | ||
- | | |-- lightbox | ||
- | | | ||
- | | | ||
- | | |-- prettyurls | ||
- | | | ||
- | | | ||
- | | `-- thumb | ||
- | | `-- lang | ||
- | | `-- lang.en-us.php | ||
- | `-- fp-setup | ||
- | `-- lang | ||
- | `-- lang.en-us.php | ||
- | </ | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | ===== Shell Script ===== | ||
- | Usage: ./ | ||
- | |||
- | where ' | ||
- | |||
- | |||
- | 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/ | ||
- | LANG=$1 | ||
- | DEST=$ROOT/ | ||
- | |||
- | 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/ | ||
- | |||
- | echo COPYING MAIN LANG FILES | ||
- | cp -Rf $CURRENT/ | ||
- | echo DONE | ||
- | |||
- | mkdir $DEST/ | ||
- | echo COPYING PLUGIN LANG FILES | ||
- | for A in $CURRENT/ | ||
- | if [ -e $A/lang/ ] ; then | ||
- | THEFILE=`basename $A` | ||
- | echo $THEFILE : COPYING LANG FILE | ||
- | THEDIR=$DEST/ | ||
- | mkdir -p $THEDIR | ||
- | cp $CURRENT/ | ||
- | fi | ||
- | done | ||
- | echo | ||
- | |||
- | echo CREATING PACKAGE | ||
- | |||
- | tar cjf fp-lang-$LANG.tar.bz2 $DEST | ||
- | |||
- | echo LANG files for $LANG are in $DEST | ||
- | </ | ||
- | |||
- | 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 " | ||
- | 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 files: Everything under fp-interface/ |
+ | - Plugin language files: All files in fp-plugins/ | ||
+ | - Setup language file: the file in setup/lang/ folder. | ||
+ | ==== How to publish? ==== | ||
+ | === On GitHub === | ||
+ | If you are familiar with GitHub, simply fork [[https:// | ||
- | </code> | + | === Manually === |
+ | 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. | ||
+ | Publish your language pack on the [[res: |
doc/lang/packs/guidelines.1559837549.txt.gz · Last modified: 2019/06/06 18:12 by arvid