The current implementation of extract-messages.sh does not support extracting of pot files dedicated for a specific major version. A related support could be easily added by specifing two additional get text wrapper, which could be used in Messages.sh. See the following example: Say we have a major version A and B there should be in version A extract-messages.sh the following code fragment: if test -f Messages.sh; then # Note: Messages.sh is supposed to get the translators' placeholder by rc.cpp enpodir=$enpodir \ podir=$podir \ srcdir=. \ XGETTEXT_PROGRAM="${XGETTEXT:-xgettext}" \ XGETTEXT_WWW="${XGETTEXT:-xgettext} $XGETTEXT_FLAGS_WWW" \ XGETTEXT="kde_xgettext" \ XGETTEXT_A="kde_xgettext" \ XGETTEXT_B="true" \ PACKAGE=$PACKAGE \ bash Messages.sh fi and in version B if test -f Messages.sh; then # Note: Messages.sh is supposed to get the translators' placeholder by rc.cpp enpodir=$enpodir \ podir=$podir \ srcdir=. \ XGETTEXT_PROGRAM="${XGETTEXT:-xgettext}" \ XGETTEXT_WWW="${XGETTEXT:-xgettext} $XGETTEXT_FLAGS_WWW" \ XGETTEXT="kde_xgettext" \ XGETTEXT_B="kde_xgettext" \ XGETTEXT_A="true" \ PACKAGE=$PACKAGE \ bash Messages.sh fi In a Message.sh file intended for version A there should be used #!/bin/sh $EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp $XGETTEXT_A `find . -name \*.cc -o -name \*.cpp -o -name \*.h -name \*.qml` -o $podir/my_version_a.pot rm rc.cpp in a Messages.sh file indented for version B #!/bin/sh $EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp $XGETTEXT_B `find . -name \*.cc -o -name \*.cpp -o -name \*.h -name \*.qml` -o $podir/my_version_b.pot rm rc.cpp and in a Messages.sh file indented for version A and B #!/bin/sh $EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp $XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h -name \*.qml` -o $podir/my_version_a_and_b.pot rm rc.cpp In the case where a Messages.sh is called for an unsupported major version the gettext related command line is expanded to true `find . -name \*.cc -o -name \*.cpp -o -name \*.h -name \*.qml` -o $podir/my_version_b.pot and is ignored.
https://phabricator.kde.org/D19302
https://phabricator.kde.org/D19303
The branch specific code is handled inside each branch (branches/stable/l10n-kf5, trunk/l10n-kf5, branches/stable/l10n-kde4). Right now alkimia translations (which would be the only user of this) are extracted only into the kf5 branches. Even if alkimia can be compiled against both Qt4 and Qt5, the translations can be extracted only inside kf5 branch and shipped together in the tarball.