Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sajaki
authored and
Sajaki
committed
Jan 30, 2016
1 parent
5852d26
commit eded672
Showing
4 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
# | ||
# This file is part of the hookup extension for phpBB | ||
# | ||
# @copyright (c) gn#36 | ||
# @license GNU General Public License, version 2 (GPL-2.0) | ||
# | ||
# | ||
set -e | ||
set -x | ||
|
||
EXTNAME=$1 | ||
BRANCH=$2 | ||
|
||
# This assumes that we are still in the ext-dir | ||
EXTPATH=. | ||
LANGTESTPATH=../../langtest | ||
|
||
if [ -d $LANGTESTPATH ]; then | ||
rm -r $LANGTESTPATH | ||
fi | ||
mkdir $LANGTESTPATH | ||
cp -r $EXTPATH/language/ $LANGTESTPATH/language | ||
|
||
# Fake a plural rule (this is extension specific, since we need to allow an array of 0-3 for the hookup constants here | ||
lang='$lang' | ||
for i in $(ls $EXTPATH/language/) | ||
do | ||
echo "<?php | ||
if (!defined('IN_PHPBB')) | ||
{ | ||
exit; | ||
} | ||
if (empty($lang) || !is_array($lang)) | ||
{ | ||
$lang = array(); | ||
} | ||
$lang = array_merge($lang, array( | ||
'PLURAL_RULE' => 3, | ||
));" > $LANGTESTPATH/language/$i/common.php | ||
done | ||
|
||
# copy the license file to all languages to avoid that fatal error | ||
for i in $(ls $EXTPATH/language/) | ||
do | ||
cp $EXTPATH/license.txt $LANGTESTPATH/language/$i/LICENSE | ||
done | ||
|
||
# link to vendor dir and travis dir | ||
currentdir=`pwd` | ||
cd $EXTPATH | ||
absextpath=`pwd` | ||
cd $currentdir | ||
ln -s $absextpath/vendor/ $LANGTESTPATH/vendor | ||
ln -s $absextpath/travis/ $LANGTESTPATH/travis | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
# | ||
# This file is part of the hookup extension for phpBB | ||
# | ||
# @copyright (c) gn#36 | ||
# @license GNU General Public License, version 2 (GPL-2.0) | ||
# | ||
# | ||
#set -e | ||
#set -x | ||
|
||
echo "Running language tests" | ||
retval=true | ||
# we should be in phpBB3, so we need to go up one level into the langtest dir: | ||
cd ../langtest ; | ||
|
||
for i in $(ls language/) | ||
do | ||
php vendor/bin/PhpbbTranslationValidator.php validate --language-dir=language $i | ||
if [ ! $? -eq 0 ]; then | ||
retval=false | ||
fi | ||
echo ""; | ||
done; | ||
|
||
cd ../phpBB3 | ||
if [ "$retval" = true ]; then | ||
exit 0 | ||
fi | ||
exit 1 |