From 86d5cf6d6cd11fb744b0a26634f4de7c48f67af0 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 6 May 2016 13:47:02 +0200 Subject: [PATCH] Don't require ejabberd to be installed to run "make translations" --- contrib/extract_translations/extract_translations.erl | 7 ++----- contrib/extract_translations/prepare-translation.sh | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/contrib/extract_translations/extract_translations.erl b/contrib/extract_translations/extract_translations.erl index 467100236..70304761a 100644 --- a/contrib/extract_translations/extract_translations.erl +++ b/contrib/extract_translations/extract_translations.erl @@ -242,9 +242,7 @@ print_usage() -> print_po_header(File) -> MsgProps = get_msg_header_props(File), {Language, [LastT | AddT]} = prepare_props(MsgProps), - application:load(ejabberd), - {ok, Version} = application:get_key(ejabberd, vsn), - print_po_header(Version, Language, LastT, AddT). + print_po_header(Language, LastT, AddT). get_msg_header_props(File) -> {ok, F} = file:open(File, [read]), @@ -274,12 +272,11 @@ prepare_props(MsgProps) -> Authors = proplists:get_all_values("Author:", MsgProps), {Language, Authors}. -print_po_header(Version, Language, LastTranslator, AdditionalTranslatorsList) -> +print_po_header(Language, LastTranslator, AdditionalTranslatorsList) -> AdditionalTranslatorsString = build_additional_translators(AdditionalTranslatorsList), HeaderString = "msgid \"\"\n" "msgstr \"\"\n" - "\"Project-Id-Version: " ++ Version ++ "\\n\"\n" ++ "\"X-Language: " ++ Language ++ "\\n\"\n" "\"Last-Translator: " ++ LastTranslator ++ "\\n\"\n" ++ AdditionalTranslatorsString ++ diff --git a/contrib/extract_translations/prepare-translation.sh b/contrib/extract_translations/prepare-translation.sh index 56f999247..98c282cc1 100755 --- a/contrib/extract_translations/prepare-translation.sh +++ b/contrib/extract_translations/prepare-translation.sh @@ -157,7 +157,7 @@ extract_lang_srcmsg2po () echo $MSGS_PATH cd $SRC_DIR - $ERL -pa $EXTRACT_DIR -pa $EBIN_DIR -pa $EJA_SRC_DIR -pa /lib/ejabberd/include -noinput -noshell -s extract_translations -s init stop -extra -srcmsg2po . $MSGS_PATH >$PO_PATH.1 + $ERL -pa $EXTRACT_DIR -pa $EBIN_DIR -pa $EJA_SRC_DIR -pa ../include -noinput -noshell -s extract_translations -s init stop -extra -srcmsg2po . $MSGS_PATH >$PO_PATH.1 sed -e 's/ \[\]$/ \"\"/g;' $PO_PATH.1 > $PO_PATH.2 msguniq --sort-by-file $PO_PATH.2 --output-file=$PO_PATH @@ -176,7 +176,7 @@ extract_lang_src2pot () echo "" >>$MSGS_PATH cd $SRC_DIR - $ERL -pa $EXTRACT_DIR -pa $EBIN_DIR -pa $EJA_SRC_DIR -pa /lib/ejabberd/include -noinput -noshell -s extract_translations -s init stop -extra -srcmsg2po . $MSGS_PATH >$POT_PATH.1 + $ERL -pa $EXTRACT_DIR -pa $EBIN_DIR -pa $EJA_SRC_DIR -pa ../include -noinput -noshell -s extract_translations -s init stop -extra -srcmsg2po . $MSGS_PATH >$POT_PATH.1 sed -e 's/ \[\]$/ \"\"/g;' $POT_PATH.1 > $POT_PATH.2 #msguniq --sort-by-file $POT_PATH.2 $EJA_MSGS_DIR --output-file=$POT_PATH