1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00
Commit Graph

5560 Commits

Author SHA1 Message Date
Jonas Fonseca
2d813f2cbf Introduce enum sgml_parser_code and make the parsers return something 2006-01-02 17:14:51 +01:00
Jonas Fonseca
fcf7677584 Skip spaces immediately when recognising '<?ident' 2006-01-02 16:58:48 +01:00
Jonas Fonseca
8c9324cc37 Add test for SGML such as, e.g. '<parent<child/></parent>' 2006-01-02 16:26:01 +01:00
Jonas Fonseca
0071ea696c Fix logic in update_number_of_lines() and tell parse_sgml() src is complete 2006-01-02 14:59:54 +01:00
Jonas Fonseca
2664a11a68 Merge with git+ssh://pasky/srv/git/elinks.git 2006-01-02 14:59:42 +01:00
Laurent MONIN
3f3b18e53b Indentation fix. 2006-01-02 10:50:49 +01:00
Jonas Fonseca
58c31f44a0 Clearify the code a bit 2006-01-02 03:06:47 +01:00
Jonas Fonseca
dc10be626e The attribute parsing of proc. instruction nodes has the complete source 2006-01-02 02:44:01 +01:00
Jonas Fonseca
f608e2a0ae Add the concept of completeness to strings being parsed and scanned
... not used yet.
2006-01-02 02:08:20 +01:00
Jonas Fonseca
6e9a18b444 fix a few bugs for line counting in plain text 2006-01-02 01:49:12 +01:00
Jonas Fonseca
7717862401 Make it possible to pass --print-lines to test line counting 2006-01-02 01:48:08 +01:00
Jonas Fonseca
247debe34f Add get_sgml_parser_line_number(), and fix a copy/paste error 2006-01-02 01:47:02 +01:00
Jonas Fonseca
275ba0b789 Use common print_indent() to simplify printf()-strings 2006-01-02 00:32:22 +01:00
Jonas Fonseca
b83bbf9c4a Add sgml_parser_flag which can be used to specify SGML_PARSER_COUNT_LINES 2006-01-02 00:29:37 +01:00
Jonas Fonseca
1801a21b50 init_sgml_parser(): Rename flags to stack_flags 2006-01-02 00:29:36 +01:00
Jonas Fonseca
5a031a7c74 Fix test of $(srcdir) to have sane exit code when it is empty 2006-01-02 00:28:23 +01:00
Kalle Olavi Niemitalo
eb99af7a33 Merge with http://elinks.cz/elinks.git 2006-01-02 01:27:11 +02:00
Laurent MONIN
54997c506f Drop trailing whitespaces. 2006-01-02 00:15:20 +01:00
c06c1a35c5 Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2006-01-02 00:08:07 +01:00
9a24f86a99 Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2006-01-02 00:07:44 +01:00
Jonas Fonseca
43b34dcb2f Add DocBook element and attribute definitions and drop a bogus file 2006-01-01 23:59:57 +01:00
Laurent MONIN
4ced25779d Add missing b flag to fopen() call. 2006-01-01 23:47:34 +01:00
Jonas Fonseca
021af4e87c Although aware ELinks doesn't need another sgml/doctype here is DocBook
It was created a long time ago so (I think) it deserves to survive. It
maps .sgml files to applicatino/docbook+xml and uses the highlighter.
2006-01-01 23:22:10 +01:00
Jonas Fonseca
7d64cb893c Improve (or rather fix) how document types are matched in the DOM renderer 2006-01-01 23:14:16 +01:00
Jonas Fonseca
c656a96a73 Use the simpler strcasecmp() instead of strcaselcmp() 2006-01-01 23:05:34 +01:00
Jonas Fonseca
479039fb9e Also highlight HTML if the MIME type is application/xhtml+xml 2006-01-01 23:02:41 +01:00
Kalle Olavi Niemitalo
a035b22426 Added the missing semicolon for the check-po rule.
It is needed there even in the last command, because it's in a foreach loop.
2006-01-02 00:00:40 +02:00
Jonas Fonseca
322e28ff0c Merge with git+ssh://pasky/srv/git/elinks.git 2006-01-01 22:55:13 +01:00
Kalle Olavi Niemitalo
08efa818aa Merge with http://elinks.cz/elinks.git 2006-01-01 23:55:02 +02:00
Jonas Fonseca
9c50072c97 Fix more problems when $(srcdir) is empty
Thanks to Kalle Olavi Niemitalo and Adam Golebiowski.
2006-01-01 22:54:44 +01:00
69e2ceb1d0 Polish translation was updated. 2006-01-01 22:54:20 +01:00
Kalle Olavi Niemitalo
dd9b321d15 Moved Perl scripts to a "perl" directory and imported Locale::PO. 2006-01-01 23:32:42 +02:00
Kalle Olavi Niemitalo
21f61c5c06 Specify accelerator contexts for "Form f~ields". 2006-01-01 23:31:41 +02:00
Kalle Olavi Niemitalo
451f23d272 Doh, make the Perl scripts executable. 2006-01-01 19:30:29 +02:00
Kalle Olavi Niemitalo
345ba7afcd Merge with http://elinks.cz/elinks.git 2006-01-01 19:05:44 +02:00
Kalle Olavi Niemitalo
4c2831677a Here is a framework that detects cases where a PO file assigns
the same accelerator key to multiple buttons in a dialog box or
to multiple items in a menu.  ELinks already has some support for
this but it requires the translator to run ELinks and manually
scan through all menus and dialogs.  The attached changes make it
possible to quickly detect and list any conflicts, including ones
that can only occur on operating systems or configurations that
the translator is not currently using.

The changes have no immediate effect on the elinks executable or
the MO files.  PO files become larger, however.

The scheme works like this:

- Like before, accelerator keys in translatable strings are
  tagged with the tilde (~) character.

- Whenever a C source file defines an accelerator key, it must
  assign one or more named "contexts" to it.  The translations in
  the PO files inherit these contexts.  If multiple strings use
  the same accelerator (case insensitive) in the same context,
  that's a conflict and can be detected automatically.

- The contexts are defined with "gettext_accelerator_context"
  comments in source files.  These comments delimit regions where
  all translatable strings containing tildes are given the same
  contexts.  There must be one special comment at the top of the
  region; it lists the contexts assigned to that region.  The
  region automatically ends at the end of the function (found
  with regexp /^\}/), but it can also be closed explicitly with
  another special comment.  The comments are formatted like this:

    /* [gettext_accelerator_context(foo, bar, baz)]
         begins a region that uses the contexts "foo", "bar", and "baz".
         The comma is the delimiter; whitespace is optional.

       [gettext_accelerator_context()]
         ends the region.  */

  The scripts don't currently check whether this syntax occurs
  inside or outside comments.

- The names of contexts consist of C identifiers delimited with
  periods.  I typically used the name of a function that sets
  up a dialog, or the name of an array where the items of a
  menu are listed.  There is a special feature for static
  functions: if the name begins with a period, then the period
  will be replaced with the name of the source file and a colon.

- If a menu is programmatically generated from multiple parts,
  of which some are never used together, so that it is safe to
  use the same accelerators in them, then it is necessary to
  define multiple contexts for the same menu.  link_menu() in
  src/viewer/text/link.c is the most complex example of this.

- During make update-po:

  - A Perl script (po/gather-accelerator-contexts.pl) reads
    po/elinks.pot, scans the source files listed in it for
    "gettext_accelerator_context" comments, and rewrites
    po/elinks.pot with "accelerator_context" comments that
    indicate the contexts of each msgid: the union of all
    contexts of all of its uses in the source files.  It also
    removes any "gettext_accelerator_context" comments that
    xgettext --add-comments has copied to elinks.pot.

  - If po/gather-accelerator-contexts.pl does not find any
    contexts for some use of an msgid that seems to contain an
    accelerator (because it contains a tilde), it warns.  If the
    tilde refers to e.g. "~/.elinks" and does not actually mark
    an accelerator, the warning can be silenced by specifying the
    special context "IGNORE", which the script otherwise ignores.

  - msgmerge copies the "accelerator_context" comments from
    po/elinks.pot to po/*.po.  Translators do not edit those
    comments.

- During make check-po:

  - Another Perl script (po/check-accelerator-contexts.pl) reads
    po/*.po and keeps track of which accelerators have been bound
    in each context.  It warns about any conflicts it finds.
    This script does not access the C source files; thus it does
    not matter if the line numbers in "#:" lines are out of date.

This implementation is not perfect and I am not proposing to
add it to the main source tree at this time.  Specifically:

- It introduces compile-time dependencies on Perl and Locale::PO.
  There should be a configure-time or compile-time check so that
  the new features are skipped if the prerequisites are missing.

- When the scripts include msgstr strings in warnings, they
  should transcode them from the charset of the PO file to the
  one specified by the user's locale.

- It is not adequately documented (well, except perhaps here).

- po/check-accelerator-contexts.pl reports the same conflict
  multiple times if it occurs in multiple contexts.

- The warning messages should include line numbers, so that users
  of Emacs could conveniently edit the conflicting part of the PO
  file.  This is not feasible with the current version of
  Locale::PO.

- Locale::PO does not understand #~ lines and spews warnings
  about them.  There is an ugly hack to hide these warnings.

- Jonas Fonseca suggested the script could propose accelerators
  that are still available.  This has not been implemented.

There are three files attached:

- po/gather-accelerator-contexts.pl: Augments elinks.pot with
  context information.

- po/check-accelerator-contexts.pl: Checks conflicts.

- accelerator-contexts.diff: Makes po/Makefile run the scripts,
  and adds special comments to source files.
2006-01-01 18:55:18 +02:00
Laurent MONIN
c3cb0ba44e French translation was updated. 2006-01-01 17:53:34 +01:00
Jonas Fonseca
5e4e13286c 'ELinks now' becomes 'ELinks (Elated)' 2006-01-01 17:36:29 +01:00
Jonas Fonseca
bb463d17f2 Fix po/Makefile w.r.t. the new value of $(srcdir) when srcdir == buildir 2006-01-01 17:34:12 +01:00
Miciah Dashiel Butler Masters
34588e976d Change the keyboard accelerator for the cookie browser's Clear button
from C to L for great consistency.
2006-01-01 09:16:42 +00:00
Miciah Dashiel Butler Masters
290a03787b Redo a small comment. 2006-01-01 08:07:14 +00:00
Miciah Dashiel Butler Masters
227150d100 Merge the definition and initialisation of msg in 2006-01-01 08:07:14 +00:00
Miciah Dashiel Butler Masters
127b27bd49 Use listbox_message. 2006-01-01 08:07:14 +00:00
Miciah Dashiel Butler Masters
2ee5b85b9e Introduce and use local variable ops, assigned the value of box->ops, 2006-01-01 08:07:14 +00:00
Miciah Dashiel Butler Masters
985efb99b6 Introduce a macro listbox_message(msg) that tries ops->messages->msg 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
6114066803 Replace unsigned char *delete_messages[2][DELETE_ERRORS] with struct 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
4e83efb6d3 Drop a comment that should have gone with revision 1.129. 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
eeed2cd4a8 Use the local variable item instead of context->item, which is assigned 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
247fe95fea In hierbox_ev_kbd, use the local variable selected, which is assigned 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
4eb0cbf271 Introduce and use local variable item, assigned the value of 2006-01-01 08:07:13 +00:00