X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=jsgettext.pl;h=da18b3db3e61d8260c2781ed8a12d5b7a5130ee6;hb=906a9786a964d6dcaae4c74fd0bb63e2202f8c43;hp=2aeaaec6414da0f1c980df51275904f0f58ca7ad;hpb=3f7b114386e4e788baa8e53aba263eb2480243e9;p=proxmox-i18n.git diff --git a/jsgettext.pl b/jsgettext.pl index 2aeaaec..da18b3d 100755 --- a/jsgettext.pl +++ b/jsgettext.pl @@ -10,7 +10,7 @@ use Encode; my $options = {}; -getopts('o:b:', $options) || +getopts('o:b:p:', $options) || die "unable to parse options\n"; my $dirs = [@ARGV]; @@ -21,6 +21,8 @@ foreach my $dir (@$dirs) { die "no such directory '$dir'\n" if ! -d $dir; } +my $projectId = $options->{p} || die "missing project ID\n"; + my $basehref = {}; if (my $base = $options->{b}) { my $aref = Locale::PO->load_file_asarray($base) || @@ -53,10 +55,12 @@ PVE::Tools::run_command($findcmd, outfunc => sub { my $header = <<__EOD; Proxmox message catalog. -Copyright (C) 2011-2017 Proxmox Server Solutions GmbH -This file is distributed under the same license as the proxmox-mailgateway -package. -Proxmox Support Team , 2017. +Copyright (C) 2011-2020 Proxmox Server Solutions GmbH +This file is free software: you can redistribute it and\/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +Proxmox Support Team , 2020. __EOD my $ctime = scalar localtime; @@ -66,7 +70,7 @@ my $po = new Locale::PO(-msgid=> '', -comment=> $header, -fuzzy=> 1, -msgstr=> - "Project-Id-Version: proxmox-mailgateway 5.0\n" . + "Project-Id-Version: $projectId\n" . "Report-Msgid-Bugs-To: \n" . "POT-Creation-Date: $ctime\n" . "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" . @@ -114,7 +118,7 @@ sub extract_msg { foreach my $s (@$sources) { open(SRC, $s) || die "unable to open file '$s' - $!\n"; while(defined(my $line = )) { - next if $line =~ m/^function gettext/; + next if $line =~ m/^\s*function gettext/; if ($line =~ m/gettext\s*\(/) { extract_msg($s, $., $line); }