Blob Blame History Raw
###############################################################################
#
#  The CentOS HTML files
#  Copyright (C) 2019  Alain Reguera Delgado
#
#  This program is free software: you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by the Free
#  Software Foundation, either version 3 of the License, or (at your option)
#  any later version.
#
#  This program is distributed in the hope that it will be useful, but WITHOUT
#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
#  more details.
#
#  You should have received a copy of the GNU General Public License along with
#  this program.  If not, see <https://www.gnu.org/licenses/>.
#
###############################################################################

#==============================================================================
# Configuration
#==============================================================================
lang = en-US
localedir = PO

#==============================================================================
# Requirements
#==============================================================================
all:

po: $(localedir)/$(lang).po

#==============================================================================
# Sources
#==============================================================================
$(localedir)/$(lang).pot: centos-*/index.tpl.html
	xml2po -l $(lang) -o /tmp/$(lang).pot centos-*/index.tpl.html
	if [[ ! -f $(localedir)/$(lang).pot ]];then \
		msginit -i /tmp/$(lang).pot -o $(localedir)/$(lang).pot -l $(lang) --no-translator --width=80; \
	else \
		msgmerge -U $(localedir)/$(lang).pot /tmp/$(lang).pot; \
	fi
	rm /tmp/$(lang).pot
$(localedir)/$(lang).po: $(localedir)/$(lang).pot
	if [[ ! -f $(localedir)/$(lang).po ]];then \
		msginit -i $(localedir)/$(lang).pot -o $(localedir)/$(lang).po -l $(lang) --no-translator --width=80; \
	else \
		msgmerge -U $(localedir)/$(lang).po $(localedir)/$(lang).pot; \
	fi