[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Debian JP master SVN www commits (rev.1061)
=======================================================
Repository: /org/svn.debian.or.jp/repos
Revision: 1061
Commiter: nabetaro
Date: 2010-07-01 18:37:27 +0900 (木, 01 7月 2010)
=======================================================
Log:
Build trans_table (tt) from table.skk on update.
NOTE: Old contents are not removed yet.
=======================================================
Changed:
A www/trunk/progs/skk2tt.pl
U www/trunk/progs/update
Copied: www/trunk/progs/skk2tt.pl (from rev 1060, www/trunk/src/community/translate/trans_table/skk2sgml.pl)
===================================================================
--- www/trunk/progs/skk2tt.pl (rev 0)
+++ www/trunk/progs/skk2tt.pl 2010-07-01 09:37:27 UTC (rev 1061)
@@ -0,0 +1,58 @@
+#!/usr/bin/perl
+# -*- mode: perl -*-
+# Copyright (C) 1998, Mitsuru Oka <oka@debian.or.jp>
+# Modify for Template Toolkit by 2010, KURASAWA Nozomu <nabetaro@debian.or.jp>
+
+%words = {}; # insert a,b,c,...,z,etc.. of array
+
+# 擬似 skk フォーマットをパース、中間テーブル構築
+while(<>) {
+ next if /^(;.*|)$/;
+ m|([a-zA-Z][a-zA-Z0-9-.\s]*)\s+(/.+/)$| || die "error `$_'";
+ my $keyword = $1;
+ my $key = uc(substr($keyword,0,1));
+ my $transwords = $2;
+
+ if ($word{$key}) {
+ $word{$key}->{$keyword} = $transwords;
+ } else {
+ $word{$key} = {};
+ $word{$key}{$keyword} = $transwords;
+ }
+}
+
+$current_time = localtime time; # 更新日付
+
+# TT コード生成ヘッダ部分
+print <<"EOL";
+[% title = "Debian JP Doc/WWW 対訳表" %]
+<h2>Debian JP Doc/WWW 対訳表</h2>
+<p>
+これは Debian JP Doc/WWW Project において訳語統一の指針として
+扱っている対訳表です。
+</p>
+<address>$current_time</address>
+
+EOL
+
+# TT コード生成部
+foreach (sort keys %word) {
+ my $key = $_;
+
+ print <<"EOL";
+<!-- ---------------------------------------------------------------- -->
+ <h2> [$_] </h2>
+<!-- ---------------------------------------------------------------- -->
+ <dl>
+EOL
+ my $c_word = $word{$key};
+ foreach (sort keys %$c_word) {
+ my $keyword = $_;
+ print <<"EOL";
+ <dt>$keyword</dt><dd>$c_word->{$keyword}</dd>
+EOL
+ }
+ print <<EOL;
+ </dl>
+EOL
+}
Modified: www/trunk/progs/update
===================================================================
--- www/trunk/progs/update 2010-06-27 06:54:22 UTC (rev 1060)
+++ www/trunk/progs/update 2010-07-01 09:37:27 UTC (rev 1061)
@@ -13,6 +13,8 @@
$ret .="mirror " if /MirrorsJP.list/;
}; print "$ret"')
+progs/skk2tt.pl src/community/translate/trans_table/table.skk > src/community/translate/trans_table.tt2
+
case "$1" in
recreate)
echo "remove all files from www directory and recreate..."