diff options
author | Alexander Reichle-Schmehl <tolimar> | 2008-06-12 23:41:40 +0000 |
---|---|---|
committer | Alexander Reichle-Schmehl <tolimar> | 2008-06-12 23:41:40 +0000 |
commit | 81e29fde5f4b95e12c97a4a29257f9821458a21d (patch) | |
tree | 81b14ce8bfb7eabd1576f383daa7b5150b783d3c /english/template/debian/projectnews | |
parent | 05071a5082703da7fd90aa1b07a584e8d05aac75 (diff) |
Creating templates for the Project News
CVS version numbers
english/template/debian/projectnews/footer.wml: INITIAL -> 1.1
english/template/debian/projectnews/header.wml: INITIAL -> 1.1
english/template/debian/projectnews/index.wml: INITIAL -> 1.1
Diffstat (limited to 'english/template/debian/projectnews')
-rw-r--r-- | english/template/debian/projectnews/footer.wml | 203 | ||||
-rw-r--r-- | english/template/debian/projectnews/header.wml | 5 | ||||
-rw-r--r-- | english/template/debian/projectnews/index.wml | 73 |
3 files changed, 281 insertions, 0 deletions
diff --git a/english/template/debian/projectnews/footer.wml b/english/template/debian/projectnews/footer.wml new file mode 100644 index 00000000000..c09d64f4d81 --- /dev/null +++ b/english/template/debian/projectnews/footer.wml @@ -0,0 +1,203 @@ +#use wml::debian::common_tags + +<define-tag subscribe> + <gettext>To receive this newsletter bi-weekly in your mailbox, <a href="http://lists.debian.org/debian-news/">subscribe to the debian-news mailing list</a>.</gettext> +</define-tag> + +<define-tag backissues whitespace=delete> + <gettext><a href="../../">Back issues</a> of this newsletter are available.</gettext> +</define-tag> + +<define-tag editor_form_singular whitespace=delete> +# One editor name only + <gettext><void id="singular" />Debian Project News is edited by <a href="mailto:debian-publicity@lists.debian.org">%s</a>.</gettext> +</define-tag> + +<define-tag editor_form_plural whitespace=delete> +# Two or more editors + <gettext><void id="plural" />Debian Project News is edited by <a href="mailto:debian-publicity@lists.debian.org">%s</a>.</gettext> +</define-tag> + +<define-tag issue_editor_form_singular whitespace=delete> +# One editor name only + <gettext><void id="singular" />This issue of Debian Project News was edited by <a href="mailto:debian-publicity@lists.debian.org">%s</a>.</gettext> +</define-tag> + +<define-tag issue_editor_form_plural whitespace=delete> +# Two or more editors + <gettext><void id="plural" />This issue of Debian Project News was edited by <a href="mailto:debian-publicity@lists.debian.org">%s</a>.</gettext> +</define-tag> + +<define-tag translator_singular whitespace=delete> +# One translator only + <gettext><void id="singular" />It was translated by %s.</gettext> +</define-tag> + +<define-tag translator_plural whitespace=delete> +# Two ore more translators + <gettext><void id="plural" />It was translated by %s.</gettext> +</define-tag> + +<define-tag translator_singular_female whitespace=delete> +# One female translator only + <gettext><void id="singularfemale" />It was translated by %s.</gettext> +</define-tag> + +<define-tag translator_plural_female whitespace=delete> +# Two ore more female translators + <gettext><void id="pluralfemale" />It was translated by %s.</gettext> +</define-tag> + +<define-tag translator whitespace=delete> +<:{ + my $translator = '$(translator)'; + my $plural = 0; + my $female = 0; + if (length ($translator)) { + $plural = 1 if $translator =~ /,/; + $female = 1 if $translator =~ /\{f\}/; + $_ = $translator; + s/\{f\}//; +<protect pass="2"> + s/\s*([^@,]+)((?<=<)[^,>]+@[^,>]+(?=>))/<a href='mailto:$2'>$1\/a/g; +</protect> + $translator = $_; + if ($CUR_ISO_LANG eq 'en') { + $translator =~ s/,([^,]+)$/ and $1/; + $translator =~ s/,/, /g; + } elsif ($CUR_ISO_LANG eq 'de') { + $translator =~ s/,([^,]+)$/ und $1/; + $translator =~ s/,/, /g; + } elsif ($CUR_ISO_LANG eq 'sv') { + $translator =~ s/,([^,]+)$/ och $1/; + $translator =~ s/,/, /g; + $translator =~ s/'/"/g; + } elsif ($CUR_ISO_LANG eq 'no' || $CUR_ISO_LANG eq 'da') { + $translator =~ s/,([^,]+)$/ og $1/; + $translator =~ s/,/, /g; + } elsif ($CUR_ISO_LANG eq 'hr') { + $translator =~ s/,([^,]+)$/ i $1/; + $translator =~ s/,/, /g; + $translator =~ s/'/"/g; + } elsif ($CUR_ISO_LANG eq 'fr') { + $translator =~ s/,([^,]+)$/ et $1/; + $translator =~ s/,\s*/, /g; + $translator =~ s/'([^',]+)'/« $1 »/g; + } elsif ($CUR_ISO_LANG eq 'ru') { + $translator =~ s/,([^,]+)$/ É $1/; + $translator =~ s/,/, /g; + } elsif ($CUR_ISO_LANG eq 'pl') { + $translator =~ s/,([^,]+)$/ i $1/; + $translator =~ s/,/, /g; + } elsif ($CUR_ISO_LANG eq 'pt') { + $translator =~ s/,([^,]+)$/ e $1/; + $translator =~ s/,/, /g; + } else { + # Fallback to the english style if there's no translation yet + $translator =~ s/,([^,]+)$/ and $1/; + $translator =~ s/,/, /g; + } + printf "<br />"; + printf q{<translator_singular />}, $translator unless $plural or $female; + printf q{<translator_plural />}, $translator if $plural and ! $female; + printf q{<translator_singular_female />}, $translator if ! $plural and $female; + printf q{<translator_plural_female />}, $translator if $plural and $female;} +}:> +</define-tag> + +<define-tag editor whitespace=delete> +<:{ + my $editor = "$(editor)"; + my $plural = 0; + if (!length ($editor)) { + my $path = q|<get-var WML_SRC_DIRNAME />|; + my ($issue, $year, $null) = split /\//, scalar reverse $path; + $year = reverse $year; + $issue = reverse $issue; + if ($year =~ /^\d+$/) { + + # This is a normal issue + } elsif ($issue =~/^\d+$/) { + # year/index.wml or equivalent. + $year = $issue; + $issue = 999; + } else { + $year = 9999; + $issue = 0; + } + + if ($year >= 2008) { + $editor = "Alexander 'Tolimar' Schmehl"; + } elsif (($year > 2002) or (($year == 2002) and ($issue >= 31))) { + $editor = "Martin 'Joey' Schulze"; + } elsif (($year > 2002) or (($year == 2002) and ($issue >= 2))) { + $editor = "Yooseong Yang, Martin 'Joey' Schulze"; + } elsif (($year > 2001) or (($year >= 2001) and ($issue >= 20))) { + $editor = "Joe 'Zonker' Brockmeier, Martin 'Joey' Schulze"; + } elsif (($year > 2001) or (($year >= 2001) and ($issue >= 10))) { + $editor = "Joe 'Zonker' Brockmeier, Jean-Christophe Helary, Tollef Fog Heen"; + } else { + $editor = "Joey Hess"; + } + } + + $plural = 1 if $editor =~ /,/; + + if ($CUR_ISO_LANG eq 'en') { + $editor =~ s/,([^,]+)$/ and $1/; + $editor =~ s/,/, /g; + } elsif ($CUR_ISO_LANG eq 'de') { + $editor =~ s/,([^,]+)$/ und $1/; + $editor =~ s/,/, /g; + } elsif ($CUR_ISO_LANG eq 'sv') { + $editor =~ s/,([^,]+)$/ och $1/; + $editor =~ s/,/, /g; + $editor =~ s/'/"/g; + } elsif ($CUR_ISO_LANG eq 'no' || $CUR_ISO_LANG eq 'da') { + $editor =~ s/,([^,]+)$/ og $1/; + $editor =~ s/,/, /g; + } elsif ($CUR_ISO_LANG eq 'hr') { + $editor =~ s/,([^,]+)$/ i $1/; + $editor =~ s/,/, /g; + $editor =~ s/'/"/g; + } elsif ($CUR_ISO_LANG eq 'fr') { + $editor =~ s/,([^,]+)$/ et $1/; + $editor =~ s/,/, /g; + $editor =~ s/'([^',]+)'/« $1 »/g; + } elsif ($CUR_ISO_LANG eq 'ru') { + $editor =~ s/,([^,]+)$/ É $1/; + $editor =~ s/,/, /g; + } elsif ($CUR_ISO_LANG eq 'pl') { + $editor =~ s/,([^,]+)$/ i $1/; + $editor =~ s/,/, /g; + } elsif ($CUR_ISO_LANG eq 'pt') { + $editor =~ s/,([^,]+)$/ e $1/; + $editor =~ s/,/, /g; + } else { + # Fallback to the english style if there's no translation yet + $editor =~ s/,([^,]+)$/ and $1/; + $editor =~ s/,/, /g; + } + + if ("$(NOBACKISSUES)" eq "") { + printf q{<issue_editor_form_singular />}, $editor unless $plural; + printf q{<issue_editor_form_plural />}, $editor if $plural; + } else { + printf q{<editor_form_singular />}, $editor unless $plural; + printf q{<editor_form_plural />}, $editor if $plural; + } +}:> +</define-tag> + +<hrline/> + +<p><subscribe/></p> + +<ifeq "$(NOBACKISSUES)" "" +"<p><backissues/></p>" +/> + +<p> +<editor/> +<translator/> +</p> diff --git a/english/template/debian/projectnews/header.wml b/english/template/debian/projectnews/header.wml new file mode 100644 index 00000000000..398dd5596f0 --- /dev/null +++ b/english/template/debian/projectnews/header.wml @@ -0,0 +1,5 @@ +#use wml::std::tags +#use wml::debian::common_tags +#use wml::debian::ctime +#use wml::debian::links.tags +#use wml::debian::template title="<debianprojectnews/> - <:=&spokendate('$(PUBDATE)'):>$(PAGENAME)" NOHOMELINK="yes" BARETITLE="yes" NOCOMMENTS="yes" SUMMARY="$(SUMMARY)" diff --git a/english/template/debian/projectnews/index.wml b/english/template/debian/projectnews/index.wml new file mode 100644 index 00000000000..205c09d52aa --- /dev/null +++ b/english/template/debian/projectnews/index.wml @@ -0,0 +1,73 @@ +#use wml::std::tags +#use wml::debian::openrecode + +<perl> + +use Cwd; + +# Very similar to get_recent_list except it looks for the .wml files +# inside subdirectories of the given directory, and if it finds less than +# 10, falls back to last year's news for the rest. +sub get_weeklynews_list { + my ($year, $eng_dir, $match, $noyear, $count, $stopat, $reccount, $trans_dir) = @_; + + # trans_dir should point to dir above the year dir + if ($noyear) { + $trans_dir ||= '..'; + } else { + $trans_dir ||= '.'; + } + + my $cwd = getcwd(); + if ($count || ($cwd =~ m,/\d+$, && $cwd !~ m,/$year$,)) { + $dirprefix = "../" . $year . "/"; + } + + my $str=""; + + open(CURRENT, "CURRENT-ISSUE-IS") or open(CURRENT, "$eng_dir/CURRENT-ISSUE-IS") or return ''; + my $currentissue=<CURRENT>;# </CURRENT> + chomp $currentissue; + my ($currentyear)=$currentissue=~m:^(\d+)/:; + $currentissue=~s:^\d+/::; + close CURRENT; + + opendir(DIR, "$eng_dir/$year") or return ''; + @files = grep { /^$match$/ && -f "$eng_dir/$year/$_/index.wml" } readdir(DIR); + closedir DIR; + + foreach (sort {$b <=> $a} @files) { + next if $year == $currentyear && $_ > $currentissue; # skip issues in preparation. + $_="$_/index.wml"; + $trans_title = $_; + $trans_title =~ s/wml/title/; + ($base)=m:(.*/):; + my $fh = openrecode("$trans_dir/$year/$_", "$trans_dir/$year/$trans_title", "$eng_dir/$year/$_"); + $title = ''; + $summary = ''; + $line=<$fh>; + $line=<$fh> if $line =~ m/use wml::debian::translation-check/; + if ($line =~ /PUBDATE="(.*?)"/) { + $title=newsdate($1); + } + if ($line =~ /SUMMARY="(.*?)"/) { + $summary=$1; + } + if ($title) { + $str.="<a href=\"". ($noyear ? "$dirprefix" : "$year/" )."$base\">$title</a> $summary<br />\n"; + } + close $fh; + $count++; + last if ($stopat ne '' && $count >= $stopat); + } + close DIR; + + # Get more if necessary. + if ($count < 10 && $reccount < 3 ) { + $str.=get_weeklynews_list($year - 1, $eng_dir, $match, $noyear, $count, 10, $reccount++); + } + + return $str; +} + +</perl> |