[Freeciv-Dev] Re: Few ideas and questions about NLS
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, Jan 25, 2002 at 08:04:23AM +0000, matusik_s@xxxxx wrote:
> Looking through Freeciv configuration scripts I get the
> impression that po/Makefile.in.in cannot be changed.
> Why?
>
> Aren't OUTPUT_COMANDS from configure.in too dirty?
>
> 1)
> It would be much better if Makefile.in.in was:
>
> $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
> $(XGETTEXT) --default-domain=$(PACKAGE) --
> directory=$(top_srcdir) \
> --add-comments --keyword=_ --keyword=N_ @extra_keywords@\
> --files-from=$(srcdir)/POTFILES.in \
> && test ! -f $(PACKAGE).po \
> || ( rm -f $(srcdir)/$(PACKAGE).pot \
> && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
>
> ./configure would check present version of xgettext and choose
> correct value
> for @extra_keywords@ (--keyword=Q_ --keyword=PL_ or --keyword=Q_ --
> keyword=PL_1,2)
> 2)
> If msgfmt doesn't understand msgid_plural there should be a program
> which
> converts new .po into old style:
>
> msgid "singular"
> msgid_plural "plural"
> msgstr[0] "plural case 0"
> msgstr[1] "plural case 1"
> ...
> msgstr[N] "plural case N"
>
> into
>
> msgid "singular"
> msgstr "plural case 0"
>
> msgid "plural"
> msgstr "plural case N"
>
>
>
> .po.mo: ./convert
> ./convert $< tmp.po
> $(MSGFMT) -o $@ tmp.po
> rm -f tmp.po
>
> ./convert: convert.cpp
> $(CC) convert.cpp -o ./convert
>
> 3)
> Finaly, common/fcintl.h:
>
> #define _(String) gettext(String)
> #define N_(String) String
> #define Q_(String) skip_intl_qualifier_prefix(gettext(String))
> #ifdef HAVE_NGETTEXT
> #define PL_(String1, String2, n) ngettext((String1), (String2), (n))
> #else
> #define PL_(String1, String2, n) (n == 1 ? gettext(String1) : gettext
> (String2))
> #endif
>
> 4)
> Of course if you didn't have correct versions of gettext, msgfmt,
> xgettext, you
> wouldn't be able to create translations, but you would be able to
> download,
> compile, and play Freeciv.
>
> ad 1)
> AC_MSG_CHECKING(xgettext version > 0.10.38)
> xgettext_version=`$XGETTEXT --version`
> AC_TRY_RUN([
> #include <stdio.h>
> const char* version = "$xgettext_version";
> int main(){
> int major, minor, patch;
> sscanf(version, "xgettext (GNU gettext) %d.%d.%d", &major, &minor,
> &patch );
> if (major < 1 && ( minor < 10 || (minor == 10 && patch < 39)))
> return 1;
> return 0;
> }
> ],
> [
> xgettext_version="yes"
> extra_keywords="--keyword=Q_ --keyword=PL_:1,2"
> ],
> [
> xgettext_version="no"
> extra_keywords="--keyword=Q_ --keyword=PL_"
> ],
> xgettext_version="bad"
> )
> AC_MSG_RESULT($xgettext_version)
> AC_SUBST(extra_keywords)
To 2, 3 and 4: We don't have to work around this. We can just demand
from the people which want to use the CVS version and all translators
that they install 0.10.38. All other should use the included gettext
and be happy.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"Python 2.0 beta 1 is now available [...]. There is a long list of new
features since Python 1.6, released earlier today. We don't plan on
any new releases in the next 24 hours."
-- Jeremy Hylton at Slashdot
|
|