3 # Midnight Commander - fetch doc/hints/mc.hint translations from Transifex
6 # The Free Software Foundation, Inc.
9 # Slava Zanko <slavazanko@gmail.com>, 2013
11 # This file is part of the Midnight Commander.
13 # The Midnight Commander is free software: you can redistribute it
14 # and/or modify it under the terms of the GNU General Public License as
15 # published by the Free Software Foundation, either version 3 of the License,
16 # or (at your option) any later version.
18 # The Midnight Commander is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
28 MC_SOURCE_ROOT_DIR
=${MC_SOURCE_ROOT_DIR:-$(dirname $(dirname $(dirname $(pwd))))}
30 #*** include section (source functions, for example) *******************
32 source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions"
34 #*** file scope functions **********************************************
39 for i
in $
(find "${work_dir}" -name '*.po' -print); do
40 sed -i '/^#:/d' "${i}"
44 # ----------------------------------------------------------------------
46 copyFilesToSourceDir
() {
50 exclude_list_file
=$
(getConfigFile
"po" "po-ignore.list")
52 for i
in $
(find "${work_dir}" -name '*.po' -print |
sort); do
53 [ $
(grep -c "^\s*$(basename ${i})" "${exclude_list_file}") -ne 1 ] && {
54 cp -f "${i}" "${source_dir}"
59 #*** main code *********************************************************
61 WORK_DIR
=$
(initSyncDirIfNeeded
"po")
63 receiveTranslationsFromTransifex
"${WORK_DIR}"
65 stripLocation
"${WORK_DIR}"
67 copyFilesToSourceDir
"${WORK_DIR}" "${MC_SOURCE_ROOT_DIR}/po"