File indexing completed on 2024-04-21 05:02:53

0001 #!/bin/sh
0002 
0003 # Suggested by Yuri Chornoivan in Git Review Board request 114119
0004 # https://git.reviewboard.kde.org/r/114119/
0005 # to extract strings in configuration files to be translated as well.
0006 # In C++ code used like this:
0007 #   QString translated = i18n(configGroup.readEntry("uiCaption", QString()).toUtf8().constData());
0008 find config -name \*.kbstyle -exec sed -ne '/Label=\|uiLabel\|uiCaption/p' {} \; | sed 's/.*=\([A-Za-z\(\)\/].*\)/i18n("\1");/' >>rc.cpp
0009 
0010 # Extract strings for infoMessages as well
0011 find config -name \*.kbstyle -exec sed -ne '/infoMessage/p' {} \; | sed 's/\"/\\"/g' | sed 's/[^=]*=\([A-Za-z\(\)\/].*\)/i18n("\1");/' >>rc.cpp
0012 
0013 # Taking instructions from
0014 # http://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems
0015 
0016 # invoke the extractrc script on all .ui, .rc, and .kcfg files in the sources
0017 # the results are stored in a pseudo .cpp file to be picked up by xgettext.
0018 $EXTRACTRC `find src -name \*.rc -o -name \*.ui -o -name \*.kcfg | sort -u` >>rc.cpp
0019 
0020 # call xgettext on all source files. If your sources have other filename
0021 # extensions besides .cpp and .h, just add them in the find call.
0022 $XGETTEXT `find src -name \*.h -o -name \*.cpp | grep -v '/test/'` rc.cpp -o $podir/kbibtex.pot