Commit cf5e417a authored by salaun's avatar salaun
Browse files

Add TT2-related files


git-svn-id: https://subversion.renater.fr/sympa/trunk@2291 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 626e2228
## Configuration de la liste sympa-l
## Cree le Mercredi 31 Mars 99
#send editorkey
subject [% subject %]
status [% status %]
visibility noconceal
subscribe open_notify
unsubscribe open_notify
owner
email [% owner.email %]
profile privileged
[% IF owner.gecos %]
gecos [% owner.gecos %]
[% END %]
send privateoreditorkey
[% IF topics %]
topics [% topics %]
[% END %]
web_archive
access public
archive
access owner
period week
digest 1,4 13:26
review owner
shared_doc
d_edit default
d_read public
creation
date_epoch [% creation.date_epoch %]
date [% creation.date %]
email [% creation.email %]
\ No newline at end of file
subject [% subject %]
status [% status %]
[% IF topics %]
topics [% topics %]
[% END %]
visibility noconceal
send public
web_archive
access private
archive
period month
access owner
clean_delay_queuemod 15
subscribe owner
unsubscribe open,notify
review private
invite default
custom_subject [% listname %]
digest 5 20:56
owner
email [% owner.email %]
profile privileged
[% IF owner.gecos %]
gecos [% owner.gecos %]
[% END %]
editor
email [% owner.email %]
creation
date [% creation.date %]
date_epoch [% creation.date_epoch %]
email [% creation.email %]
serial 0
subject [% subject %]
status [% status %]
[% IF topics %]
topics [% topics %]
[% END %]
visibility noconceal
send editorkeyonly
available_user_options
reception mail,nomail,txt,html
default_user_options
reception html
web_archive
access public
archive
period year
access owner
clean_delay_queuemod 15
subscribe open
unsubscribe open,notify
review owner
invite default
custom_subject [% listname %]
owner
email [% owner.email %]
profile privileged
[% IF owner.gecos %]
gecos [% owner.gecos %]
[% END %]
editor
email [% owner.email %]
creation
date [% creation.date %]
date_epoch [% creation.date_epoch %]
email [% creation.email %]
serial 0
subject [% subject %]
status [% status %]
[% IF topics %]
topics [% topics %]
[% END %]
visibility noconceal
send privateorpublickey
web_archive
access intranet
archive
period month
access owner
clean_delay_queuemod 15
subscribe intranet
unsubscribe open,notify
review private
invite default
custom_subject [% listname %]
digest 1,4 6:56
owner
email [% owner.email %]
profile privileged
[% IF owner.gecos %]
gecos [% owner.gecos %]
[% END %]
editor
email [% owner.email %]
creation
date [% creation.date %]
date_epoch [% creation.date_epoch %]
email [% creation.email %]
serial 0
subject [% subject %]
status [% status %]
[% IF topics %]
topics [% topics %]
[% END %]
visibility noconceal
send editorkeyonly
web_archive
access public
archive
period year
access owner
clean_delay_queuemod 15
subscribe open
unsubscribe open,notify
review owner
invite default
custom_subject [% listname %]
owner
email [% owner.email %]
profile privileged
[% IF owner.gecos %]
gecos [% owner.gecos %]
[% END %]
editor
email [% owner.email %]
creation
date [% creation.date %]
date_epoch [% creation.date_epoch %]
email [% creation.email %]
serial 0
subject [% subject %]
status [% status %]
[% IF topics %]
topics [% topics %]
[% END %]
visibility conceal
send privateoreditorkey
web_archive
access private
archive
period month
access owner
clean_delay_queuemod 15
reply_to_header
value list
subscribe owner
unsubscribe open,notify
review private
invite default
custom_subject [% listname %]
digest 5 20:56
owner
email [% owner.email %]
profile privileged
[% IF owner.gecos %]
gecos [% owner.gecos %]
[% END %]
editor
email [% owner.email %]
creation
date [% creation.date %]
date_epoch [% creation.date_epoch %]
email [% creation.email %]
serial 0
subject [% subject %]
status [% status %]
[% IF topics %]
topics [% topics %]
[% END %]
visibility noconceal
send privateoreditorkey
web_archive
access public
archive
period month
access owner
clean_delay_queuemod 15
reply_to_header
value list
subscribe open
unsubscribe open,notify
review owner
invite default
custom_subject [% listname %]
digest 3 4:36
default_user_options
reception summary
owner
email [% owner.email %]
profile privileged
[% IF owner.gecos %]
gecos [% owner.gecos %]
[% END %]
editor
email [% owner.email %]
creation
date [% creation.date %]
date_epoch [% creation.date_epoch %]
email [% creation.email %]
serial 0
#------------------------------ [% list.name %]: list alias created [% date %]
[% IF is_default_domain -%]
[% list.name %]: "| --MAILERPROGDIR--/queue [% list.name %]@[% list.domain %]"
[% list.name %]-request: "| --MAILERPROGDIR--/queue [% list.name %]-request@[% list.domain %]"
[% list.name %]-editor: "| --MAILERPROGDIR--/queue [% list.name %]-editor@[% list.domain %]"
#[% list.name %]-subscribe: "| --MAILERPROGDIR--/queue [% list.name %]-subscribe@[% list.domain %]"
[% list.name %]-unsubscribe: "| --MAILERPROGDIR--/queue [% list.name %]-unsubscribe@[% list.domain %]"
[% list.name %]-owner: "| --MAILERPROGDIR--/bouncequeue [% list.name %]@[% list.domain %]"
[% ELSE -%]
[% list.domain %]-[% list.name %]: "| --MAILERPROGDIR--/queue [% list.name %]@[% list.domain %]"
[% list.domain %]-[% list.name %]-request: "| --MAILERPROGDIR--/queue [% list.name %]-request@[% list.domain %]"
[% list.domain %]-[% list.name %]-editor: "| --MAILERPROGDIR--/queue [% list.name %]-editor@[% list.domain %]"
#[% list.domain %]-[% list.name %]-subscribe: "| --MAILERPROGDIR--/queue [% list.name %]-subscribe@[% list.domain %]"
[% list.domain %]-[% list.name %]-unsubscribe: "| --MAILERPROGDIR--/queue [% list.name %]-unsubscribe@[% list.domain %]"
[% list.domain %]-[% list.name %]-owner: "| --MAILERPROGDIR--/bouncequeue [% list.name %]@[% list.domain %]"
[% END -%]
#! --PERL--
# tpl2tt2.pl - This script will concert existing templates (mail and web) from the old native
# Sympa template format to the TT2 format
#
# Sympa - SYsteme de Multi-Postage Automatique
# Copyright (c) 1997, 1998, 1999, 2000, 2001 Comite Reseau des Universites
# Copyright (c) 1997,1998, 1999 Institut Pasteur & Christophe Wolfhugel
#
# 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 2 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
use lib '--LIBDIR--';
use wwslib;
require "tt2.pl";
$wwsympa_conf_file = '--WWSCONFIG--';
$sympa_conf_file = '--CONFIG--';
use List;
use Log;
my %options;
my $pinfo = &List::_apply_defaults();
$| = 1;
## Check UID
unless (getlogin() eq '--USER--') {
print "You should run this script as user \"sympa\", ignore ? (y/CR)";
my $s = <STDIN>;
die unless ($s =~ /^y$/i);
}
my $wwsconf = {};
## Load config
unless ($wwsconf = &wwslib::load_config($wwsympa_conf_file)) {
die 'unable to load config file';
}
## Load sympa config
unless (&Conf::load($sympa_conf_file)) {
die 'config_error';
}
@directories;
## Search in main robot
if (-d "$Conf::Conf{'etc'}/templates") {
push @directories, "$Conf::Conf{'etc'}/templates";
}
if (-d "$Conf::Conf{'etc'}/wws_templates") {
push @directories, "$Conf::Conf{'etc'}/wws_templates";
}
## Go through Virtual Robots
foreach my $vr (keys %{$Conf::Conf{'robots'}}) {
## Search in etc/
if (-d "$Conf::Conf{'etc'}/$vr/templates") {
push @directories, "$Conf::Conf{'etc'}/$vr/templates";
}
if (-d "$Conf::Conf{'etc'}/$vr/wws_templates") {
push @directories, "$Conf::Conf{'etc'}/$vr/wws_templates";
}
## Search in V. Robot Lists
foreach my $l ( &List::get_lists($vr) ) {
my $list = new List ($l);
next unless $list;
push @directories, $list->{'dir'};
if (-d "$list->{'dir'}/templates") {
push @directories, "$list->{'dir'}/templates";
}
if (-d "$list->{'dir'}/wws_templates") {
push @directories, "$list->{'dir'}/wws_templates";
}
}
}
my @templates;
## List .tpl files
foreach my $d (@directories) {
unless (opendir DIR, $d) {
print STDERR "Error: Cannot read %s directory : %s", $d, $!;
next;
}
foreach my $tpl (sort grep(/\.tpl$/,readdir DIR)) {
push @templates, "$d/$tpl";
}
closedir DIR;
}
my $total;
foreach my $tpl (@templates) {
unless (-r $tpl) {
print STDERR "Error : Unable to read file %s\n", $tpl;
next;
}
unless ($tpl =~ /^(.+)\/([^\/]+)$/) {
print STDERR "Error : Incorrect Path %s\n", $tpl;
next;
}
my ($path, $file) = ($1, $2);
my ($dest_path, $dest_file);
## Destinatination Path
$dest_path = $path;
if ($path =~ /\/wws_templates$/) {
$dest_path =~ s/wws_templates/web_tt2/;
}else {
if ($path =~ /\/templates$/) {
$dest_path =~ s/templates/tt2/;
}else {
$dest_path .= '/tt2';
}
}
## Destination filename
$dest_file = $file;
$dest_file =~ s/\.tpl$/\.tt2/;
## Create directory if required
unless (-d $dest_path) {
printf "Creating $dest_path directory\n";
unless (mkdir ($dest_path, 0777)) {
printf STDERR "Error : Cannot create $dest_path directory : $!\n";
next;
}
chown '--USER--', '--GROUP--', $dest_path;
}
my $tt2 = "$dest_path/$dest_file";
## Convert tpl file
unless (open TPL, $tpl) {
print STDERR "Cannot open $tpl : $!\n";
next;
}
unless (open TT2, ">$tt2") {
print STDERR "Cannot create $tt2 : $!\n";
next;
}
while (<TPL>) {
print TT2 Sympa::Template::Compat::_translate($_);
}
close TT2;
close TPL;
chown '--USER--', '--GROUP--', $tt2;
$total++;
printf "Template file $tpl has been converted to $tt2\n";
## Rename old files to .converted
unless (rename $tpl, "$tpl.converted") {
print STDERR "Error : failed to rename $tpl to $tpl.converted : $!\n";
next;
}
}
print "\n$total template files have been converted\n";
#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0; # not running under some shell
# $File: //member/autrijus/Locale-Maketext-Lexicon/bin/xgettext.pl $ $Author$
# $Revision$ $Change: 5999 $ $DateTime: 2003/05/20 07:50:59 $
## [O. Salaun] 12/08/02 : Also look for gettext() in perl code
## No more escape '\' chars
## Extract gettext_id entries from List.pm
## Extract title.gettext entries from scenarios
use strict;
use Getopt::Std;
use Pod::Usage;
use constant NUL => 0;
use constant BEG => 1;
use constant PAR => 2;
use constant QUO1 => 3;
use constant QUO2 => 4;
use constant QUO3 => 5;
=head1 NAME
xgettext.pl - Extract gettext strings from source
=head1 SYNOPSIS
B<xgettext.pl> [ B<-u> ] [ B<-g> ] [ B<-o> I<outputfile> ] [ I<inputfile>... ]
=head1 OPTIONS
[ B<-u> ] Disables conversion from B<Maketext> format to B<Gettext>
format -- i.e. it leaves all brackets alone. This is useful if you are
also using the B<Gettext> syntax in your program.
[ B<-g> ] Enables GNU gettext interoperability by printing C<#,
maketext-format> before each entry that has C<%> variables.
[ B<-o> I<outputfile> ] PO file name to be written or incrementally
updated C<-> means writing to F<STDOUT>. If not specified,
F<messages.po> is used.
[ I<inputfile>... ] is the files to extract messages from.
=head1 DESCRIPTION
This program extracts translatable strings from given input files, or
STDIN if none are given.
Currently the following formats of input files are supported:
=over 4
=item Perl source files
Valid localization function names are: C<translate>, C<maketext>,
C<loc>, C<x>, C<_> and C<__>.
=item HTML::Mason