Skip to content

Commit

Permalink
Merge pull request #3233 from Kaspik/localisations
Browse files Browse the repository at this point in the history
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. # Localizes all of the application's NIB files. This script should only be run by Xcode.


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

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

#
# Update 'Localizable.strings' by running genstrings(1) # 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 # Check for genstrings errors
if [[ ${GENSTRINGS_ERRORS} -ne 0 ]] #if [[ ${GENSTRINGS_ERRORS} -ne 0 ]]
then #then
echo "error: genstrings exited with error: ${GENSTRINGS_ERRORS}" # echo "error: genstrings exited with error: ${GENSTRINGS_ERRORS}"
fi #fi

#
echo "Updating nib and xib localisations..." #echo "Updating nib and xib localisations..."

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


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


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


echo "Cleaning remains of any previous nightly builds..." 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 languagetranslations &> /dev/null
rm -rf $IBSTRINGSDIR &> /dev/null rm -rf $IBSTRINGSDIR &> /dev/null


echo "Creating IB strings files for rekeying..." #echo "Creating IB strings files for rekeying..."
mkdir -p $IBSTRINGSDIR/English.lproj #mkdir -p $IBSTRINGSDIR/English.lproj
find "$XIB_BASE" \( -name "*.xib" \) | while read FILE; do #find "$XIB_BASE" \( -name "*.xib" \) | while read FILE; do
printf "\t$(basename ${FILE})\n" # printf "\t$(basename ${FILE})\n"
ibtool "$FILE" --export-strings-file "$IBSTRINGSDIR/English.lproj/`basename "$FILE" .xib`.strings" # ibtool "$FILE" --export-strings-file "$IBSTRINGSDIR/English.lproj/`basename "$FILE" .xib`.strings"
done #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 # Download the latest language translations, and copy them into the Resources directory
curl http://dev.sequelpro.com/translate/download/sequelpro > languagetranslations.zip #curl http://dev.sequelpro.com/translate/download/sequelpro > languagetranslations.zip
unzip -q languagetranslations.zip -d languagetranslations #unzip -q languagetranslations.zip -d languagetranslations

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


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


echo "Signing build..." echo "Signing build..."


Expand Down Expand Up @@ -186,4 +186,4 @@ then
exit 1 exit 1
fi 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 <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. 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) ![Screenshot](https://sequelpro.com/images/browse.png)


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


* Install the [latest version of Xcode](https://itunes.apple.com/au/app/xcode/id497799835) * 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)) * 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) * If the above doesn't work, please file a [bug report](https://github.com/sequelpro/sequelpro/issues/new)


Contributing 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. 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.