Merge branch 'cc-5709-airtime-analyzer' into cc-5709-airtime-analyzer-cloud-storage

This commit is contained in:
drigato 2014-10-08 11:46:30 -04:00
commit 2423ea6787
108 changed files with 24748 additions and 2164 deletions

View file

@ -0,0 +1,9 @@
#!/bin/bash
# Set up 3 way PO file merging, which we need for non-mainline branches
cp scripts/git-merge-po /usr/local/bin
chmod +x /usr/local/bin/git-merge-po
cat scripts/git-config-git-merge-po >> ../.git/config
cat scripts/git-attributes-git-merge-po >> ../.gitattributes

View file

@ -0,0 +1,2 @@
*.po merge=pofile
*.pot merge=pofile

View file

@ -0,0 +1,5 @@
[merge "pofile"]
name = Gettext merge driver
driver = git merge-po %O %A %B

View file

@ -0,0 +1,44 @@
#!/bin/sh
#
# https://gist.github.com/mezis/1605647
# by Julien Letessier (mezis)
#
# Custom Git merge driver - merges PO files using msgcat(1)
#
# - Install gettext
#
# - Place this script in your PATH
#
# - Add this to your .git/config :
#
# [merge "pofile"]
# name = Gettext merge driver
# driver = git merge-po %O %A %B
#
# - Add this to .gitattributes :
#
# *.po merge=pofile
# *.pot merge=pofile
#
# - When merging branches, conflicts in PO files will be maked with "#-#-#-#"
#
O=$1
A=$2
B=$3
# Extract the PO header from the current branch (top of file until first empty line)
header=$(mktemp /tmp/merge-po.XXXX)
sed -e '/^$/q' < $A > $header
# Merge files, then repair header
temp=$(mktemp /tmp/merge-po.XXXX)
msgcat -o $temp $A $B
msgcat --use-first -o $A $header $temp
# Clean up
rm $header $temp
# Check for conflicts
conflicts=$(grep -c "#-#" $A)
test $conflicts -gt 0 && exit 1
exit 0

View file

@ -4,7 +4,7 @@ cd ..
#generate a new .po file
#this will generate a file called messages.po
find . -iname "*.phtml" -o -name "*.php" | xargs xgettext -L php
find . -iname "*.phtml" -o -name "*.php" | xargs xgettext -L php --from-code=UTF-8
#merge the new messages from messages.po into each existing .po file
#this will generate new .po files