1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
tinygettext API related stuff:
==============================
* translate, translate_ctxt, translate_ctxt_plural, ... could be
unified via overloading, not sure if that is a good idea. For the
same reason add_translation() could be de-overloaded, to
add_translation_ctxt, ...
* iconv handling needs cleanup and more flexibility, since some
systems don't provide iconv or only through SDL
* Customizability could use grouping and documentation or other means
to make it more obvious:
- POParser::pedantic
- iconv (???)
- logging (log_callback(std::string))
* handle errors better, not with log_* stream, cases of errors:
- couldn't translate
- collision while adding translation
- failure to open file or directory
- unknown language
- iconv failure to convert charset
* ABI management/freezing. If tinygettext is to benefit other projects,
it should be able to provide a stable API (and, better, ABI).
tinygettext implementation details:
===================================
* with PluralForms moved into Dictionary a lot of the Langugae stuff
is pointless
* get rid of goto
* POParser can handle Big5, but needs testing.
Big5 is one byte for ASCII letters and two bytes for chinese ones,
this means some two byte characters collide with '\', some .po files
seem to escape the \ properly so that the string can be read as
usual, while others don't.
* _() -> getext() (gettext default)
N_(id) -> gettext_noop(id) (gettext default)
C_(ctxt, id) -> pgettext(ctxt, id) (Gnome does this: http://library.gnome.org/devel/glib/2.16/glib-I18N.html#Q-:CAPS)
NC_(ctxt, id) -> pgettext(ctxt, id) (Gnome does this: http://library.gnome.org/devel/glib/2.16/glib-I18N.html#Q-:CAPS)
* figure out how up-to-date other tinygettext implementations in the
wild are (LinCity):
Pingus:
-------
dictionary.hpp (synced with Pingus)
dictionary_manager.hpp (PhysFS vs opendir())
language_def.hpp (synced with Pingus)
po_file_reader.hpp (UTF-8 0xef-'header', lots of stuff from mathner)
tinygettext.hpp (iconv vs convert)
Random Unimportant Stuff
========================
* a hashmap instead of std::map might be a good idea
* support for .gmo files would be cool
tinygettext Documentation:
==========================
* recommend a way to handle translation of speech and other data files
* document how to use tinygettext and make it work like gettext
# EOF #
|