Am 24/11/16 um 01:57 schrieb Glen De Cauwsemaecker:
I am the (currently only :() developer of "L20n for games", trying to
bring l20n to games, as you guys bring l20n to the web. Games are
getting more social as well (especially Mobile F2P games), and thus
will require even more complex translations (if that wasn't already
the case).
Between February and May of this year I developed the C# L20n Library
and Unity plugin based on those specs. You can find the Unity Plugin
Repository here: https://github.com/GlenDC/L20n.unity (The L20n.cs
repository is included as a submodule). All of the current published
work is open source, free and gratis.
Looking back at it, and after several conversations with some of my
users, I learned that Mozilla is now pushing L20n, with the FTL format
(btw what does FTL stand for?). Therefore I am now working again on
L20n.cs to support L20n (FTL) and have moved all old code to the L10n
namespace. That work in progress can be followed at
https://github.com/GlenDC/L20n.cs
I mostly understand L20n (FTL) based on the grammar.ebnf file (found
in l20n/spec), l20n.org/learn and some other places (such as
l20n/l20n.js).
I do have a couple of unresolved questions, for which I couldn't find an answer:
1) L10n had the concept of private entities, where the identifier
started with an underscore `_`. Those could only be referenced from
within the same or another l10n file. I see that with L20n an
identifier can still start with an underscore `_`, but I don't see any
reference of a private entity anywhere, so am I correct to assume that
this has been removed as a feature in this new version?
This still works, it's just not an explicit concept for now. We might
add that back if it turns out to be important in practice. Much of what
we've done is trying to make things simpler, and this was one of those
things.
You can have entities that are only within a particular localization,
but you'd need a way to tool that. Tooling is one of the things that's
much easier if you just need to deal with 1-1 corresponding entries in
en-US and each locale.
2) I have seen on l20n.org/learn that sections are a way to group
entities (messages) together, but I have never seen an example how
this influences the translation calls. Do they work as namespaces,
such that you have to call `section.identifier` instead of simply
`identifier`?
Sections only affect which comments are in scope for which entity. If
they exist or not doesn't play a role for the developer or for how you
reference the entities.
3) What happened to globals? In L10n the library could provide globals
that were accessible similar to variables, but starting with `@`
instead of `$`. Examples of those were screen information, OS
information and so on. I used this to expose info given by Unity that
could be used by the localizer. Users of the L20n.Unity library could
also add their own globals custom to their games. Would this now have
to be done by using builtins?
Yes, builtins are the new globals. Convention is that they're ALLCAPS.
In our implementation, we pass them as additional information from the
platform binding to the MessageContext objects. See
https://github.com/l20n/l20n.js/blob/master/src/runtime/gecko/l20n.js#L37
for an example.
4) My last question, I promise. Is there anywhere information
available about what types are allowed as external variables?
We currently start with JSON-ish, but we're thinking about more.
https://github.com/l20n/l20n.js/blob/master/src/intl/types.js is the
start, with String, Number, DateTime, List (of the other).
We think that it'll make sense to have Number-with-formatting-annotation
later, too. So you'd pass in that this is a currency, Dollars, two
significant digits. Only some of that would be allowed to be overwritten
by the localizer. In particular, the currency wouldn't :-).
We're building on top of ICU/CLDR for many of the formatting operations
now, instead of having localizers write macros to do that.
With my new push for support I'm trying to stay 100% compatible with
what you guys do. I also have a repository where I collect my
understanding as documentation, you can see it at
https://github.com/GlenDC/L20n.design/blob/master/design/l20n.md
We did remove PLURAL, as it's the same as NUMBER. That's required so
that you can match explicit numbers in the keys.
I know this is a lot to ask for a first question, but I would be
really grateful if I could get some answers on these questions.
Happy to see your interest, thanks for the support.
Axel
cheers
Glen
_______________________________________________
tools-l10n mailing list
[email protected]
https://lists.mozilla.org/listinfo/tools-l10n