aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-03-08 17:53:26 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-03-08 17:53:26 +0000
commitc3f2050c4aa8cd7f6dfefac368c228cbc415f2b1 (patch)
tree8e28fe35354df0971a0f246787691834588b8b5a
parent82eb96ced884a972bc3f17c6d98268e77490144f (diff)
downloadellinika-c3f2050c4aa8cd7f6dfefac368c228cbc415f2b1.tar.gz
ellinika-c3f2050c4aa8cd7f6dfefac368c228cbc415f2b1.tar.bz2
new files
git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@29 941c8c0f-9102-463b-b60b-cd22ce0e6858
-rw-r--r--xtrans/LINGUA.html.xtrans490
-rw-r--r--xtrans/Makefile.am1
-rw-r--r--xtrans/i18n.inc48
3 files changed, 539 insertions, 0 deletions
diff --git a/xtrans/LINGUA.html.xtrans b/xtrans/LINGUA.html.xtrans
new file mode 100644
index 0000000..2e88340
--- /dev/null
+++ b/xtrans/LINGUA.html.xtrans
@@ -0,0 +1,490 @@
+# -*- mode: indented-text -*-
+# Copyright (C) 2004 Sergey Poznyakoff
+#
+# 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. */
+
+Import: copy
+Import: string
+Import: posix
+
+Include: i18n.inc
+
+Global: toc
+[]
+
+Global: menu
+{}
+
+Global: item_index
+0
+
+Global: row_index
+0
+
+Function: dict_encode_string word
+ str = ""
+ for i in range(len(word)):
+ if ord(word[i]) > 127:
+ str = str + "%" + hex(ord(word[i]))[2:]
+ else:
+ str = str + word[i]
+ return str
+
+Function: put_menu menu
+ i = 0
+ xtrans.put(">> ")
+ for x in menu:
+ if i != 0:
+ xtrans.put("| ")
+ xtrans.put("""<A NAME="%s" HREF="%s">%s</A>\n""" %
+ (x[1], x[2], x[0]))
+ i += 1
+
+
+Function: LangList title
+ def sorter(a,b,x=xtrans):
+ if x.gettext(a) > x.gettext(b):
+ return 1
+ elif x.gettext(a) < x.gettext(b):
+ return -1
+ else:
+ return 0
+
+ xtrans.put("""
+<!-- Please keep this list alphabetical -->
+<!-- PLEASE UPDATE THE LIST AT THE BOTTOM (OR TOP) OF THE PAGE TOO! -->
+""")
+ langlist = copy.copy(xtrans.linguas)
+ langlist.sort(sorter)
+ xtrans.put("""
+ <TR>
+ <TD ALIGN="CENTER">
+ <TABLE ALIGN="CENTER" BORDER=0 WIDTH="600">
+""")
+ i = 0
+ for x in langlist:
+ xtrans.put("""
+ <TD ALIGN="CENTER">
+ <A HREF="%s/%s">
+ <IMG BORDER="1" SRC="images/lang-%s.jpg" ALT="%s" WIDTH="22" HEIGHT="15">
+ </A>
+ </TD>
+""" % (x, "index.html", x, xtrans.gettext(x))) ## FIXME!
+ xtrans.put("""
+<!-- Please keep this list alphabetical -->
+<!-- PLEASE UPDATE THE LIST AT THE BOTTOM (OR TOP) OF THE PAGE TOO! -->
+ </TABLE>
+ </TD>
+ </TR>
+""")
+
+Function: PageTemplate title
+ hb = """
+<BODY BGCOLOR="#000080" TEXT="#000000" LINK="#1F00FF" ALINK="#FF0000" VLINK="#9900DD">
+<TABLE WIDTH="99%%" ALIGN="CENTER" CELLSPACING="0" CELLPADDING="10%%" BORDER="0" BGCOLOR="#FFFFFF">
+<TR>
+ <TD VALIGN=TOP width="20%%">
+ <IMG SRC="graphics/gnu-head-sm.jpg" ALIGN="top" ALT=" [A GNU head] "><P>
+ <TABLE WIDTH="100%%" ALIGN="LEFT" CELLSPACING="0" CELLPADDING="10%%" BORDER="0" BGCOLOR="#FFFFFF">
+ <TR><TD BGCOLOR="#0063C1"><CENTER><STRONG><FONT color="white">%s</FONT></STRONG></CENTER></TD></TR>
+ [TOC]
+ <TR><TD BGCOLOR="#0063C1"><CENTER><STRONG><FONT color="white">%s</FONT></STRONG></CENTER></TD></TR>
+ <TR><TD><A HREF="cgi-bin/dict.cgi?LANG=%s_%s">%s</A></TD></TR>
+
+ <TR><TD BGCOLOR="#0063C1"><CENTER><STRONG><FONT color="white">%s</FONT></STRONG></CENTER></TD></TR>
+ <TR><TD><A HREF="%s">%s</A></TD></TR>
+ <TR><TD><A HREF="http://validator.w3.org/check/referer">
+ <img border="0" src="graphics/valid-html401.png"
+ alt="[ Valid HTML 4.01! ]" height="31" width="88"></A></TD></TR>
+
+ </TABLE>
+ </TD>
+ <TD VALIGN=top>
+ <H1 ALIGN=CENTER>%s</H1>
+<HR>
+"""
+ xtrans.output.write(hb %
+ (xtrans.gettext("Γραμματική"),
+# xtrans.gettext("Λεξικός πλούτος"),
+ xtrans.gettext("Λεξιλόγιο"),
+ xtrans.attr["LINGUA"]["LANG"],
+ xtrans.attr["LINGUA"]["TER"],
+ xtrans.gettext("Ελληνορωσικό λέξικο"),
+ xtrans.gettext("Πληροφορίες"),
+ xtrans.attr["AUTHOR"]["HOMEPAGE"],
+ xtrans.gettext("Αρχική σελίδα"),
+ title))
+
+
+Function: OpenPage title, prefix
+ xtrans.SetLocale(xtrans.attr["LINGUA"]["LANG"])
+ xtrans.set_output(title, prefix)
+ if xtrans.content.has_key("AUTHOR") and xtrans.attr["AUTHOR"].has_key("EMAIL"):
+ xtrans.email = xtrans.attr["AUTHOR"]["EMAIL"]
+ else:
+ xtrans.email = "gray@gnu.org"
+ if xtrans.attr["LINGUA"].has_key("BASE"):
+ base = xtrans.attr["LINGUA"]["BASE"]
+ else:
+ base = posix.environ['BASE_HREF']
+ hb = """
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+ <TITLE>%s</TITLE>
+ <LINK REV="made" HREF="mailto:%s">
+ <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
+ <META NAME="GENERATOR" CONTENT="%s">
+ <META NAME="keywords" CONTENT="%s">
+ <BASE HREF="%s">
+</HEAD>
+"""
+ xtrans.output.write(hb % (title,
+ xtrans.email,
+ xtrans.generator,
+ xtrans.content["KEYWORDS"],
+ base))
+ xtrans.PageTemplate(title)
+
+
+Function: ClosePage
+ xtrans.output.write("""
+ </TD>
+</TR>
+<TR>
+ <TD colspan=\"2\">
+ <hr>
+%s <A HREF="mailto:%s">%s</A>;
+
+ </TD>
+</TR>
+</TABLE>
+</BODY></HTML>
+"""
+ % (
+ xtrans.gettext("Για προτάσεις ή απορίες σχετικά με αυτήν τη σελίδα επικοινωνήστε στο"),
+ xtrans.attr["AUTHOR"]["EMAIL"],
+ xtrans.attr["AUTHOR"]["CONTACT"]))
+
+Starttag: LINGUA
+ if xtrans.attr["LINGUA"].has_key("LANG"):
+ lang = xtrans.attr["LINGUA"]["LANG"] + "/"
+ else:
+ lang = ""
+ def namegen(xmlprefix, l, base, targetformat, pfx=lang):
+ return "%s%s.%s" % (pfx, base, targetformat)
+ xtrans.toc = []
+ xtrans.attr["NAMEGEN"] = namegen
+
+Endtag: LINGUA
+ xtrans.i18n_cleanup
+
+
+Starttag: MSGSTR
+ pass
+
+Endtag: MSGSTR
+ xtrans.msgid(xtrans.attr["MSGSTR"]["ID"], xtrans.content["MSGSTR"])
+
+Starttag: TITLE nostrip
+ if xtrans.is_parent("TABULAR"):
+ xtrans.put('<CAPTION>')
+
+Endtag: TITLE
+ if xtrans.is_parent("TABULAR"):
+ xtrans.put('</CAPTION>')
+
+Starttag: PAGE
+ if xtrans.attr["PAGE"].has_key("PREFIX"):
+ prefix = xtrans.attr["PAGE"]["PREFIX"]
+ else:
+ prefix = "prefix"
+ xtrans.OpenPage(xtrans.attr["PAGE"]["TITLE"], prefix)
+ if xtrans.attr["PAGE"].has_key("MENU"):
+ menu = xtrans.menu[xtrans.attr["PAGE"]["MENU"]]
+ xtrans.put_menu(menu)
+
+Endtag: PAGE
+ xtrans.ClosePage()
+
+
+Endtag: EMPH
+ xtrans.put('<EM>%s</EM>' % xtrans.content["EMPH"])
+
+Endtag: CMD
+ xtrans.put('<CODE>%s</CODE>' % xtrans.content["CMD"])
+
+
+Endtag: PROG
+ xtrans.put('<B>%s</B>' % xtrans.content["PROG"])
+
+Endtag: QUOTE
+ xtrans.put('<I>%s</I>' % xtrans.content["QUOTE"])
+
+Function: canonical_name file
+ s = file[len(xtrans.targetdir):]
+ if s[0] == '/':
+ s = s[1:]
+ return s
+
+
+Starttag: SEEALSO
+ xtrans.put("""<A HREF="%s">""" % (xtrans.attr["SEEALSO"]["HREF"]))
+
+Endtag: SEEALSO
+ xtrans.put("</A>")
+
+Function: TOCName string
+ xtrans.toc[-1][-1] = string
+
+Starttag: CHAPTER
+ toc = [1,
+ xtrans.output.name,
+ xtrans.attr["CHAPTER"]["NAME"],
+ xtrans.attr["CHAPTER"]["HREF"]]
+ xtrans.toc.append(toc)
+ xtrans.put("""<CENTER><H1><A NAME="%s">%s</A></H1></CENTER>"""
+ % (xtrans.attr["CHAPTER"]["HREF"],
+ xtrans.attr["CHAPTER"]["NAME"]))
+
+Starttag: SECTION
+ toc = [2,
+ xtrans.output.name,
+ xtrans.attr["SECTION"]["NAME"],
+ xtrans.attr["SECTION"]["HREF"]]
+ xtrans.toc.append(toc)
+
+Starttag: PARA nostrip
+ xtrans.put("\n<P>")
+
+Endtag: PARA
+ xtrans.put("</P>\n")
+
+Endtag: HEADER
+ if xtrans.is_parent("ITEMIZE"):
+ attr = xtrans.attr["ITEMIZE"]
+ n = 5
+ xtrans.put("<DT>")
+ elif xtrans.is_parent("SECTION"):
+ xtrans.TOCName(xtrans.content["HEADER"])
+ attr = xtrans.attr["SECTION"]
+ n = 4
+ elif xtrans.is_parent("CHAPTER"):
+ xtrans.TOCName(xtrans.content["HEADER"])
+ attr = xtrans.attr["CHAPTER"]
+ n = 4
+ xtrans.output.write("\n<H%d>" % n)
+ if attr.has_key("HREF"):
+ xtrans.put("""<A HREF="#%s" NAME="%s">""" %
+ (attr["HREF"], attr["NAME"]))
+ xtrans.put(xtrans.content["HEADER"])
+ if attr.has_key("HREF"):
+ xtrans.put("</A>")
+ xtrans.put("</H%d>\n" % n)
+ if xtrans.is_parent("ITEMIZE"):
+ xtrans.put("</DT>")
+
+Starttag: ITEMIZE
+ xtrans.put("<DL>")
+
+Endtag: ITEMIZE
+ xtrans.put("</DL>")
+
+
+Function: item_split text
+ if xtrans.attr["TABULAR"].has_key("SPLIT"):
+ delim = xtrans.attr["TABULAR"]["SPLIT"]
+ str = ""
+ for s in text.split(delim):
+ if str == "" :
+ str = s
+ else:
+ str = str + "&nbsp;<B>" + s + "</B>"
+ return str;
+ return text
+
+Function: item_text
+ if xtrans.attr["TABULAR"].has_key("OR"):
+ delim = xtrans.attr["TABULAR"]["OR"]
+ str = ""
+ for s in xtrans.content["ITEM"].split(delim):
+ if str == "" :
+ str = xtrans.item_split(s)
+ else:
+ str = str + "&nbsp;" + delim + "&nbsp;" + xtrans.item_split(s)
+ return str;
+ else:
+ return xtrans.item_split(xtrans.content["ITEM"])
+
+Function: restore_single_word text
+ if xtrans.attr["TABULAR"].has_key("SPLIT"):
+ delim = xtrans.attr["TABULAR"]["SPLIT"]
+ str = ""
+ for s in text.split(delim):
+ str = str + s
+ return str;
+ return text
+
+Function: restore_word
+ if xtrans.attr["TABULAR"].has_key("OR"):
+ delim = xtrans.attr["TABULAR"]["OR"]
+ return xtrans.restore_single_word(xtrans.content["ITEM"].split(delim)[0])
+ else:
+ return xtrans.restore_single_word(xtrans.content["ITEM"])
+
+Function: dict_reference word, reftext
+ xtrans.put('<A HREF="cgi-bin/dict.cgi?LANG=%s_%s&IDENT=%s">%s</A>'
+ % (xtrans.attr["LINGUA"]["LANG"],
+ xtrans.attr["LINGUA"]["TER"],
+ xtrans.dict_encode_string(word),
+ reftext))
+
+Endtag: ITEM
+ if xtrans.is_parent("ENUMERATE"):
+ xtrans.put('<LI>%s</LI>' % (xtrans.content["ITEM"]))
+ elif xtrans.is_parent("ROW"):
+ xtrans.put(" <TD")
+ if xtrans.attr["TABULAR"].has_key("ALTERNATE"):
+ if xtrans.row_index % 2 == 0:
+ xtrans.put(' BGCOLOR="#FFFFFF"')
+ else:
+ xtrans.put(' BGCOLOR="#COCOCO"')
+ xtrans.put(">")
+ if xtrans.item_index == 0 and xtrans.attr["TABULAR"].has_key("ROWHEADING"):
+ xtrans.put('<I>%s</I>' % (xtrans.content["ITEM"]))
+ else:
+ if xtrans.row_index == 0 \
+ and xtrans.attr["TABULAR"].has_key("DICTREF") \
+ and xtrans.item_index >= int(xtrans.attr["TABULAR"]["DICTREF"]):
+ xtrans.dict_reference(xtrans.restore_word(),
+ xtrans.item_text())
+ else:
+ xtrans.put(xtrans.item_text())
+ xtrans.put(" </TD>")
+ xtrans.item_index = xtrans.item_index + 1
+ else:
+ xtrans.put('<DD>%s</DD>' % (xtrans.content["ITEM"]))
+
+Endtag: FLECT
+ xtrans.put('<B>-%s</B>' % (xtrans.content["FLECT"]))
+
+Starttag: MENU
+ xtrans.menu[xtrans.attr["MENU"]["NAME"]] = []
+
+Endtag: NODE
+ m = xtrans.menu[xtrans.attr["MENU"]["NAME"]]
+ if xtrans.attr["NODE"].has_key("HREF"):
+ href = xtrans.attr["NODE"]["HREF"]
+ else:
+ href = ""
+ if xtrans.attr["NODE"].has_key("NAME"):
+ name = xtrans.attr["NODE"]["NAME"]
+ else:
+ name = xtrans.content["NODE"]
+ m.append([xtrans.content["NODE"], name, href])
+
+
+Starttag: SUBPAGE
+ if xtrans.attr["SUBPAGE"].has_key("BAR"):
+ xtrans.put("""
+ <TR>
+ <TD ALIGN="LEFT">
+ <HR NOSHADE WIDTH="100%%">
+ </TD>
+ </TR>""")
+ xtrans.put("""
+ <TR>
+ <TD ALIGN="LEFT" """)
+ if xtrans.attr["SUBPAGE"].has_key("SHADE"):
+ xtrans.put(" BGCOLOR=\"COCOCO\"")
+ xtrans.put(">\n")
+
+
+
+Endtag: SUBPAGE
+ xtrans.put("""
+ </TD>
+ </TR>
+""")
+
+Starttag: ENUMERATE
+ xtrans.put("""
+ <UL>
+""")
+
+
+Endtag: ENUMERATE
+ xtrans.put("""
+ </UL>
+""")
+
+Endtag: BOLD
+ xtrans.put("""<B>%s</B>""" % (xtrans.content["BOLD"]))
+
+
+Endtag: UBOLD
+ xtrans.put("""<U><B>%s</B></U>""" % (xtrans.content["UBOLD"]))
+
+Endtag: IT
+ xtrans.put('<I>%s</I>' % (xtrans.content["IT"]))
+
+Starttag: TABULAR
+ xtrans.put('<TABLE CELLPADDING="10%"')
+ if not xtrans.attr["TABULAR"].has_key("BESTFIT"):
+ xtrans.put(' WIDTH="100%"')
+ if xtrans.attr["TABULAR"].has_key("SHADE"):
+ xtrans.put(" BGCOLOR=\"COCOCO\"")
+ xtrans.row_index = 0
+ xtrans.put(">\n")
+
+Endtag: TABULAR
+ xtrans.put("</TABLE>\n")
+
+Starttag: ROW
+ xtrans.item_index = 0
+ xtrans.put("<TR>\n")
+
+Endtag: ROW
+ xtrans.row_index = xtrans.row_index + 1
+ xtrans.put("</TR>\n")
+
+
+Starttag: LOCALIZATION
+ pass
+
+Endtag: MSGSTR
+ xtrans.msgid(xtrans.attr["MSGSTR"]["ID"], xtrans.content["MSGSTR"])
+
+Postmacro: TOC
+ if xtrans.attr["LINGUA"].has_key("TARGETDIR"):
+ pfx = xtrans.attr["LINGUA"]["TARGETDIR"] + "/"
+ else:
+ pfx = posix.environ['TARGET_DIR'] + "/"
+ filenum = len(xtrans.labels)
+ for i in range(filenum-1):
+ xtrans.put('<TR><TD><A HREF="%s%s">%s</A></TD></TR>\n' %
+ (pfx,
+ xtrans.filenames[i],
+ xtrans.labels[i]))
+
+Postmacro: TOC_DETAILED
+ for item in xtrans.toc:
+ xtrans.put("<TR><TD><A HREF=\"")
+ xtrans.put(xtrans.canonical_name(item[1]))
+ xtrans.put("""#%s" NAME="TOC%s">%s</A></TD></TR>\n""" %
+ (item[3], item[3], item[2]))
+
+
+
diff --git a/xtrans/Makefile.am b/xtrans/Makefile.am
new file mode 100644
index 0000000..e58c9f2
--- /dev/null
+++ b/xtrans/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST=LINGUA.html.xtrans i18n.inc \ No newline at end of file
diff --git a/xtrans/i18n.inc b/xtrans/i18n.inc
new file mode 100644
index 0000000..15d0e27
--- /dev/null
+++ b/xtrans/i18n.inc
@@ -0,0 +1,48 @@
+# -*- mode: indented-text -*-
+# This file is part of GNU RADIUS documentation.
+# Copyright (C) 2000,2001,2002 Sergey Poznyakoff
+#
+# 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. */
+
+Global: linguas
+[ 'en', 'fr', 'pl', 'es', 'el', 'ru' ]
+
+
+Global: translations
+{ }
+
+Function: msgid id, str
+ xtrans.translations[id] = str
+
+Function: SetLocale lang
+ xtrans.lang = lang
+
+Function: gettext messid
+ if not xtrans.translations.has_key(messid):
+ return messid
+ return xtrans.translations[messid]
+
+Global: charset_dict
+{ 'def' : "iso-8859-1", 'pl': "iso-8859-2", 'ru': "koi8-r" }
+
+Function: charset lang
+ if not xtrans.charset_dict.has_key(lang):
+ lang = 'def'
+ return xtrans.charset_dict[lang]
+
+Function: i18n_cleanup
+ del(xtrans.translations)
+ xtrans.translations = {}
+

Return to:

Send suggestions and report system problems to the System administrator.