Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #3233 from Kaspik/localisations
Localisations skip
  • Loading branch information
rowanbeentje committed Oct 20, 2018
2 parents f9f6908 + c2a03fc commit f64cbb7
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 86 deletions.
92 changes: 46 additions & 46 deletions Scripts/localize.sh
Expand Up @@ -32,54 +32,54 @@

# Localizes all of the application's NIB files. This script should only be run by Xcode.

if [ "${BUILT_PRODUCTS_DIR}x" == 'x' ]
then
echo 'This script should only be run by Xcode. Exiting...'
exit 1
fi

echo "Running genstrings to update 'Localizable.strings'..."

#if [ "${BUILT_PRODUCTS_DIR}x" == 'x' ]
#then
# echo 'This script should only be run by Xcode. Exiting...'
# exit 1
#fi
#
#echo "Running genstrings to update 'Localizable.strings'..."
#
# Update 'Localizable.strings' by running genstrings(1)
GENSTRINGS_ERRORS=$(genstrings -o "${SRCROOT}/Resources/English.lproj" "${SRCROOT}/Source/"*.m)

#GENSTRINGS_ERRORS=$(genstrings -o "${SRCROOT}/Resources/English.lproj" "${SRCROOT}/Source/"*.m)
#
# Check for genstrings errors
if [[ ${GENSTRINGS_ERRORS} -ne 0 ]]
then
echo "error: genstrings exited with error: ${GENSTRINGS_ERRORS}"
fi

echo "Updating nib and xib localisations..."

#if [[ ${GENSTRINGS_ERRORS} -ne 0 ]]
#then
# echo "error: genstrings exited with error: ${GENSTRINGS_ERRORS}"
#fi
#
#echo "Updating nib and xib localisations..."
#
# Generate up-to-date nib .strings files for localisation
find "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"/**/*.nib | while read nibFile
do
stringsFilePath="${SOURCE_ROOT}/Resources/English.lproj/`basename "${nibFile}" .nib`.strings"
xibFile=`basename "${nibFile}" .nib`.xib
xibFilePath=`echo "${SOURCE_ROOT}"/Interfaces/**/"${xibFile}"`
if [[ -e ${xibFilePath} ]]
then
xibfileModDate=`stat -f "%m" "${xibFilePath}"`
if [[ -e ${stringsFilePath} ]]
then
stringsFileModDate=`stat -f "%m" "${stringsFilePath}"`
else
stringsFileModDate=0
fi
if [[ ${xibfileModDate} -gt ${stringsFileModDate} ]]
then
printf "\tLocalising ${xibFile}...\n";
ibtool --generate-stringsfile "${stringsFilePath}~" "${xibFilePath}"
"${BUILT_PRODUCTS_DIR}"/xibLocalizationPostprocessor "${stringsFilePath}~" "${stringsFilePath}"
rm "${stringsFilePath}~"
fi
fi
done
#find "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"/**/*.nib | while read nibFile
#do
# stringsFilePath="${SOURCE_ROOT}/Resources/English.lproj/`basename "${nibFile}" .nib`.strings"
# xibFile=`basename "${nibFile}" .nib`.xib
# xibFilePath=`echo "${SOURCE_ROOT}"/Interfaces/**/"${xibFile}"`
#
# if [[ -e ${xibFilePath} ]]
# then
# xibfileModDate=`stat -f "%m" "${xibFilePath}"`
#
# if [[ -e ${stringsFilePath} ]]
# then
# stringsFileModDate=`stat -f "%m" "${stringsFilePath}"`
# else
# stringsFileModDate=0
# fi
#
# if [[ ${xibfileModDate} -gt ${stringsFileModDate} ]]
# then
# printf "\tLocalising ${xibFile}...\n";
#
# ibtool --generate-stringsfile "${stringsFilePath}~" "${xibFilePath}"
#
# "${BUILT_PRODUCTS_DIR}"/xibLocalizationPostprocessor "${stringsFilePath}~" "${stringsFilePath}"
#
# rm "${stringsFilePath}~"
# fi
# fi
#done

exit 0
74 changes: 37 additions & 37 deletions Scripts/nightlybuildscript.sh
Expand Up @@ -45,7 +45,7 @@ then
fi

IBSTRINGSDIR=ibstrings
XIB_BASE="$GIT_DIR/Interfaces/English.lproj"
#XIB_BASE="$GIT_DIR/Interfaces/English.lproj"

echo "Cleaning remains of any previous nightly builds..."

Expand All @@ -56,39 +56,39 @@ rm -f languagetranslations.zip &> /dev/null
rm -rf languagetranslations &> /dev/null
rm -rf $IBSTRINGSDIR &> /dev/null

echo "Creating IB strings files for rekeying..."
mkdir -p $IBSTRINGSDIR/English.lproj
find "$XIB_BASE" \( -name "*.xib" \) | while read FILE; do
printf "\t$(basename ${FILE})\n"
ibtool "$FILE" --export-strings-file "$IBSTRINGSDIR/English.lproj/`basename "$FILE" .xib`.strings"
done
#echo "Creating IB strings files for rekeying..."
#mkdir -p $IBSTRINGSDIR/English.lproj
#find "$XIB_BASE" \( -name "*.xib" \) | while read FILE; do
# printf "\t$(basename ${FILE})\n"
# ibtool "$FILE" --export-strings-file "$IBSTRINGSDIR/English.lproj/`basename "$FILE" .xib`.strings"
#done

echo "Downloading localizations to merge in..."
#echo "Downloading localizations to merge in..."
# Download the latest language translations, and copy them into the Resources directory
curl http://dev.sequelpro.com/translate/download/sequelpro > languagetranslations.zip
unzip -q languagetranslations.zip -d languagetranslations

echo "Rekeying localization files, translating xibs, merging localizations..."
find languagetranslations/Resources \( -name "*.lproj" \) | while read FILE; do
loc=`basename "$FILE"`
mkdir "$IBSTRINGSDIR/$loc"
printf "\tRekeying localization: $loc\n"
find "$FILE" \( -name "*.strings" \) | while read STRFILE; do
file=`basename "$STRFILE" .strings`
printf "\t\tFile: $file\n"
ibkeyfile="$IBSTRINGSDIR/English.lproj/$file.strings"
xibfile="$XIB_BASE/$file.xib"
transfile="$IBSTRINGSDIR/$loc/$file.strings"
if [ -e "$ibkeyfile" ] && [ -e "$xibfile" ]; then
$BUILD_DIR/xibLocalizationPostprocessor "$STRFILE" "$ibkeyfile" "$transfile"
#curl http://dev.sequelpro.com/translate/download/sequelpro > languagetranslations.zip
#unzip -q languagetranslations.zip -d languagetranslations
#
#echo "Rekeying localization files, translating xibs, merging localizations..."
#find languagetranslations/Resources \( -name "*.lproj" \) | while read FILE; do
# loc=`basename "$FILE"`
# mkdir "$IBSTRINGSDIR/$loc"
# printf "\tRekeying localization: $loc\n"
# find "$FILE" \( -name "*.strings" \) | while read STRFILE; do
# file=`basename "$STRFILE" .strings`
# printf "\t\tFile: $file\n"
# ibkeyfile="$IBSTRINGSDIR/English.lproj/$file.strings"
# xibfile="$XIB_BASE/$file.xib"
# transfile="$IBSTRINGSDIR/$loc/$file.strings"
# if [ -e "$ibkeyfile" ] && [ -e "$xibfile" ]; then
# $BUILD_DIR/xibLocalizationPostprocessor "$STRFILE" "$ibkeyfile" "$transfile"
#we no longer need the original file and don't want to copy it
rm -f "$STRFILE"
ibtool "$xibfile" --import-strings-file "$transfile" --compile "languagetranslations/Resources/$loc/$file.nib"
fi
done
printf "\tCopying localization: $loc\n"
cp -R "$FILE" "Sequel Pro.app/Contents/Resources/"
done
# rm -f "$STRFILE"
# ibtool "$xibfile" --import-strings-file "$transfile" --compile "languagetranslations/Resources/$loc/$file.nib"
# fi
# done
# printf "\tCopying localization: $loc\n"
# cp -R "$FILE" "Sequel Pro.app/Contents/Resources/"
#done

#echo "Copying nightly icon"

Expand All @@ -108,11 +108,11 @@ php -r '$infoplistloc = "'$BUILD_DIR'/Sequel Pro.app/Contents/Info.plist";

# Update versions in localised string files
php -r '$englishstringsloc = "/'$BUILD_DIR'/Sequel Pro.app/Contents/Resources/English.lproj/InfoPlist.strings";
$englishstrings = file_get_contents($englishstringsloc);
$englishstrings = mb_convert_encoding($englishstrings, "UTF-8", "UTF-16");
$englishstrings = preg_replace("/version [^\,\"]+/iu", "nightly build for r'$SHORT_HASH'", $englishstrings);
$englishstrings = mb_convert_encoding($englishstrings, "UTF-16", "UTF-8");
file_put_contents($englishstringsloc, $englishstrings);'
$englishstrings = file_get_contents($englishstringsloc);
$englishstrings = mb_convert_encoding($englishstrings, "UTF-8", "UTF-16");
$englishstrings = preg_replace("/version [^\,\"]+/iu", "nightly build for r'$SHORT_HASH'", $englishstrings);
$englishstrings = mb_convert_encoding($englishstrings, "UTF-16", "UTF-8");
file_put_contents($englishstringsloc, $englishstrings);'

echo "Signing build..."

Expand Down Expand Up @@ -186,4 +186,4 @@ then
exit 1
fi

echo "Done!"
echo "Done!"
6 changes: 3 additions & 3 deletions readme.md
@@ -1,5 +1,5 @@
Sequel Pro <img alt="Logo" src="https://sequelpro.com/images/logo.png" align="right" height="50">
==========
=======

Sequel Pro is a fast, easy-to-use Mac database management application for working with MySQL & MariaDB databases.

Expand All @@ -8,7 +8,7 @@ You can find more details on our website: [sequelpro.com](https://sequelpro.com)
![Screenshot](https://sequelpro.com/images/browse.png)

Build Instructions
==================
=======

* Install the [latest version of Xcode](https://itunes.apple.com/au/app/xcode/id497799835)
* Install [GitHub for Mac](https://desktop.github.com/) (or [SourceTree](https://www.sourcetreeapp.com/), or [](https://git-scm.com/downloads/guis))
Expand All @@ -18,7 +18,7 @@ Build Instructions
* If the above doesn't work, please file a [bug report](https://github.com/sequelpro/sequelpro/issues/new)

Contributing
============
=======

The best way to help the project is to use our [test builds](https://sequelpro.com/test-builds) and report any issues (both bugs and missing features) in [the issue tracker](https://github.com/sequelpro/sequelpro/issues). If you want to get more involved, then you can comment on issues written by other people or send us a pull request.

Expand Down

0 comments on commit f64cbb7

Please sign in to comment.