cheers, Jeff
> --
> You received this message because you are subscribed to the Google
> Groups "mozilla-labs-jetpack" group.
> To post to this group, send email to mozilla-la...@googlegroups.com.
> To unsubscribe from this group, send email to
> mozilla-labs-jet...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mozilla-labs-jetpack?hl=en.
My concern is that you are enshrining a convention into the process (
const _ = require("l10n").get; ) that is not very descriptive, *and* has
some confusing history to it. Had you considered something slightly
longer like:
var l10n = require("l10n").get;
var cm = require("context-menu");
cm.Item({
label: l10n("My Menu Item"),
context: cm.URLContext("*.mozilla.org")
});
var localized = l10n("Translate this!");
I know, it's 3 more bytes! It is also a bit more self-explanatory. On a
more personal note I have a particular allergy to using punctuation.
Saying 'underscore' when explaining the code to someone both feels
awkward to me, and also has no connotative link with localization.
Jeff
If you are attending MozCamp this year either in either Berlin or Kuala Lumpur, we will be giving a session on SDK localization and would be happy to get feedback form the community on our approach.
cheers, Jeff
On 11-10-31 11:42 AM, Alexandre poirot wrote:
Hi Developers, localizers, and any addon contributors,
I've just published a description of our work on supporting localization
in jetpack:
http://blog.techno-barje.fr/post/2011/10/31/jetpack-localization/
I'm looking for feedback in order to ensure choosing the right balance
between
ease for developers and simplicity for localizers.
We are about to land a 100% local way to localize addons,
then we will open an online tool similar to babelzilla but for jetpack
addons.
Feel free to comment on this thread if you have any question or concern!
You may follow this work on bug 691782:
https://bugzilla.mozilla.org/show_bug.cgi?id=691782
++
Alex
--
You received this message because you are subscribed to the Google
Groups "mozilla-labs-jetpack" group.
To post to this group, send email to mozilla-labs-jetpack@googlegroups.com.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mozilla-labs-jetpack?hl=en.
--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To post to this group, send email to mozilla-labs-jetpack@googlegroups.com.
To unsubscribe from this group, send email to mozilla-labs-jetpack+unsub...@googlegroups.com.
cheers, Jeff
On 11-11-01 2:18 AM, Bogomil Shopov wrote:
>
>
> On 31 October 2011 20:20, Jeff Griffiths <jgrif...@mozilla.com
> <mailto:jgrif...@mozilla.com>> wrote:
>
> If you are attending MozCamp this year either in either Berlin or
> Kuala Lumpur, we will be giving a session on SDK localization and
> would be happy to get feedback form the community on our approach.
>
>
>
> Looking forward to it :)
>
>
> cheers, Jeff
>
>
> On 11-10-31 11:42 AM, Alexandre poirot wrote:
>
> Hi Developers, localizers, and any addon contributors,
>
> I've just published a description of our work on supporting
> localization
> in jetpack:
> http://blog.techno-barje.fr/__post/2011/10/31/jetpack-__localization/
> <http://blog.techno-barje.fr/post/2011/10/31/jetpack-localization/>
>
> I'm looking for feedback in order to ensure choosing the right
> balance
> between
> ease for developers and simplicity for localizers.
>
> We are about to land a 100% local way to localize addons,
> then we will open an online tool similar to babelzilla but for
> jetpack
> addons.
>
>
> Feel free to comment on this thread if you have any question or
> concern!
>
> You may follow this work on bug 691782:
> https://bugzilla.mozilla.org/__show_bug.cgi?id=691782
> <https://bugzilla.mozilla.org/show_bug.cgi?id=691782>
>
>
> ++
> Alex
>
> --
> You received this message because you are subscribed to the Google
> Groups "mozilla-labs-jetpack" group.
> To post to this group, send email to
> mozilla-labs-jetpack@__googlegroups.com
> <mailto:mozilla-la...@googlegroups.com>.
> To unsubscribe from this group, send email to
> mozilla-labs-jetp...@googlegroups.com
> <mailto:mozilla-labs-jetpack%2Bunsu...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/__group/mozilla-labs-jetpack?hl=__en
> <http://groups.google.com/group/mozilla-labs-jetpack?hl=en>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "mozilla-labs-jetpack" group.
> To post to this group, send email to
> mozilla-labs-jetpack@__googlegroups.com
> <mailto:mozilla-la...@googlegroups.com>.
> To unsubscribe from this group, send email to
> mozilla-labs-jetp...@googlegroups.com
> <mailto:mozilla-labs-jetpack%2Bunsu...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/__group/mozilla-labs-jetpack?hl=__en
> <http://groups.google.com/group/mozilla-labs-jetpack?hl=en>.
>
>
>
>
> --
> Bogomil "Bogo" Shopov
> Open(Web) Thinker and doer.
> http://talkweb.eu
>
>
> ++
> Education is the most powerful weapon which you can use to change the world.
> Nelson Mandela
>
> --
> You received this message because you are subscribed to the Google
> Groups "mozilla-labs-jetpack" group.
> To post to this group, send email to mozilla-la...@googlegroups.com.
> To unsubscribe from this group, send email to
> mozilla-labs-jet...@googlegroups.com.
Ah, you're attending! excellent news, it will be good to meet in person.
<mailto:mozilla-labs-jetpack@googlegroups.com>.
To unsubscribe from this group, send email to
<mailto:mozilla-labs-jetpack%2Bunsu...@googlegroups.com>.http://groups.google.com/__group/mozilla-labs-jetpack?hl=__en
For more options, visit this group at
<http://groups.google.com/group/mozilla-labs-jetpack?hl=en>.mozilla-labs-jetpack@__googlegroups.com
--
You received this message because you are subscribed to the Google
Groups "mozilla-labs-jetpack" group.
To post to this group, send email to
<mailto:mozilla-labs-jetpack@googlegroups.com>.
To unsubscribe from this group, send email to
<mailto:mozilla-labs-jetpack%2Bunsu...@googlegroups.com>.http://groups.google.com/__group/mozilla-labs-jetpack?hl=__en
For more options, visit this group at
<http://groups.google.com/group/mozilla-labs-jetpack?hl=en>.
--
Bogomil "Bogo" Shopov
Open(Web) Thinker and doer.
http://talkweb.eu
++
Education is the most powerful weapon which you can use to change the world.
Nelson Mandela
--
You received this message because you are subscribed to the Google
Groups "mozilla-labs-jetpack" group.
To post to this group, send email to mozilla-labs-jetpack@googlegroups.com.
To unsubscribe from this group, send email to
--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To post to this group, send email to mozilla-labs-jetpack@googlegroups.com.
To unsubscribe from this group, send email to mozilla-labs-jetpack+unsub...@googlegroups.com.
I'm inclined to agree with this - while I've gotten used to _() in
gettext, it still leaves a bad taste in my mouth. I guess one
compromise would be to ensure any tools looking for the _() pattern are
configurable to people are free to use whatever convention they like.
Also, from the blog:
| console.log(_("Hello %s", "alex"));
I'm wondering if using positional strings will work in all cases - eg,
consider a phrase that has 2 (or more) substitutions, but some locales
require the order of those substitutions to be different than English.
IOW, I'm wondering if something like:
...("Hello %(name)s", {name: "alex"});
might be necessary?
And finally, will plurals be supported? eg,
https://github.com/Mardak/restartless/tree/examples/l10nDialogs supports
plurals directly which seems nicer than forcing 2 different string IDs
which are logically the same message.
Mark
The key thing is about gaining automatic compatibility with existing
l10n tools/libraries.
We will be able to build specific jetpack parser for our own tools. It
can be quite tricky to implement, but it is as complex as parsing
require statements.
So that I don't expect any other generic l10n tool to support this
flexible behavior.
Compared to traditional addons, we want tools that build templates and
synchronyse locales files by parsing source code for keys to
translate. This idea comes from gettext.
>
> Also, from the blog:
>
> | console.log(_("Hello %s", "alex"));
>
> I'm wondering if using positional strings will work in all cases -
> eg, consider a phrase that has 2 (or more) substitutions, but some
> locales require the order of those substitutions to be different
> than English. IOW, I'm wondering if something like:
>
> ...("Hello %(name)s", {name: "alex"});
>
> might be necessary?
I explicitely omit speaking about any "advanced" localization feature
as it may pollute this initial discussion about overall localization
pattern.
Here we have many options : %1s, #1$s, %name, %(name), ...
Again the main question here is: how disruptive we would like to be.
From what I've seen, %1s seems to be the most common scheme. But your
proposal is obviously cleaner and may help localizers figuring out
what a string means. Do you know if this syntax is used in any l10n
format?
>
> And finally, will plurals be supported? eg, https://github.com/Mardak/restartless/tree/examples/l10nDialogs
> supports plurals directly which seems nicer than forcing 2
> different string IDs which are logically the same message.
I'm currently working on it. I should end up having something similar
to your implementation.
I'll post an update when it is ready.
>
> Mark
>
> --
> You received this message because you are subscribed to the Google
> Groups "mozilla-labs-jetpack" group.
> To post to this group, send email to mozilla-la...@googlegroups.com
> .
> To unsubscribe from this group, send email to mozilla-labs-jet...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/mozilla-labs-jetpack?hl=en
> .
>
The ability to reuse existing tools which support only _() is certainly
compelling, but I'm not sure how practical that will be. Are you saying
above that we will need to develop our own parser anyway? If so, then
we can probably build more flexibility into that. OTOH, if you are
saying existing parsers could work for Jetpack, I'd have to concede that
would be a big enough win to justify losing the flexibility.
> So that I don't expect any other generic l10n tool to support this
> flexible behavior.
> Compared to traditional addons, we want tools that build templates and
> synchronyse locales files by parsing source code for keys to translate.
> This idea comes from gettext.
>
>>
>> Also, from the blog:
>>
>> | console.log(_("Hello %s", "alex"));
>>
>> I'm wondering if using positional strings will work in all cases - eg,
>> consider a phrase that has 2 (or more) substitutions, but some locales
>> require the order of those substitutions to be different than English.
>> IOW, I'm wondering if something like:
>>
>> ...("Hello %(name)s", {name: "alex"});
>>
>> might be necessary?
>
> I explicitely omit speaking about any "advanced" localization feature as
> it may pollute this initial discussion about overall localization pattern.
> Here we have many options : %1s, #1$s, %name, %(name), ...
> Again the main question here is: how disruptive we would like to be.
> From what I've seen, %1s seems to be the most common scheme. But your
> proposal is obviously cleaner and may help localizers figuring out what
> a string means. Do you know if this syntax is used in any l10n format?
To be honest, I just stole that syntax from Python's string
interpolation - but my point wasn't about the specific syntax, but
instead was to question whether a "positional" scheme as originally
proposed would work OK.
IOW, a simple "%s" might not be good enough. "%1s" would be an
improvement and would address my specific concern, as would most of the
other suggestions (some of which I prefer more than the others, but this
isn't about my personal preferences ;)
>> And finally, will plurals be supported? eg,
>> https://github.com/Mardak/restartless/tree/examples/l10nDialogs
>> supports plurals directly which seems nicer than forcing 2 different
>> string IDs which are logically the same message.
>
> I'm currently working on it. I should end up having something similar to
> your implementation.
> I'll post an update when it is ready.
Just to be clear, that isn't my implementation (but it is an
implementation Firefox Share (aka F1) shamelessly stole :)
And while we are asking for ponies, one great feature would be the
ability to use this stuff in content scripts - such scripts can't
require() modules but may still present (part of) the UI for a Jetpack
and thus need l10n support.
Mark
On 10/11/2011 1:31 AM, Alexandre Poirot wrote:
To be honest, I just stole that syntax from Python's string interpolation - but my point wasn't about the specific syntax, but instead was to question whether a "positional" scheme as originally proposed would work OK.
So that I don't expect any other generic l10n tool to support this
flexible behavior.
Compared to traditional addons, we want tools that build templates and
synchronyse locales files by parsing source code for keys to translate.
This idea comes from gettext.
Also, from the blog:
| console.log(_("Hello %s", "alex"));
I'm wondering if using positional strings will work in all cases - eg,
consider a phrase that has 2 (or more) substitutions, but some locales
require the order of those substitutions to be different than English.
IOW, I'm wondering if something like:
...("Hello %(name)s", {name: "alex"});
might be necessary?
I explicitely omit speaking about any "advanced" localization feature as
it may pollute this initial discussion about overall localization pattern.
Here we have many options : %1s, #1$s, %name, %(name), ...
Again the main question here is: how disruptive we would like to be.
From what I've seen, %1s seems to be the most common scheme. But your
proposal is obviously cleaner and may help localizers figuring out what
a string means. Do you know if this syntax is used in any l10n format?
IOW, a simple "%s" might not be good enough. "%1s" would be an improvement and would address my specific concern, as would most of the other suggestions (some of which I prefer more than the others, but this isn't about my personal preferences ;)
Just to be clear, that isn't my implementation (but it is an implementation Firefox Share (aka F1) shamelessly stole :)
And finally, will plurals be supported? eg,
https://github.com/Mardak/restartless/tree/examples/l10nDialogs
supports plurals directly which seems nicer than forcing 2 different
string IDs which are logically the same message.
I'm currently working on it. I should end up having something similar to
your implementation.
I'll post an update when it is ready.
And while we are asking for ponies, one great feature would be the ability to use this stuff in content scripts - such scripts can't require() modules but may still present (part of) the UI for a Jetpack and thus need l10n support.
Mark
Mark
--
You received this message because you are subscribed to the Google
Groups "mozilla-labs-jetpack" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/mozilla-labs-jetpack?hl=en.
--
You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To post to this group, send email to mozilla-labs-jetpack@googlegroups.com.
To unsubscribe from this group, send email to mozilla-labs-jetpack+unsub...@googlegroups.com.
-myk
I assume there is some speed trade-off in parsing yaml vs JSON?
Jeff
On 11-11-17 10:04 AM, Alexandre Poirot wrote:
> I've just send another note on my blog:
> http://blog.techno-barje.fr/post/2011/11/17/jetpack-localization-yaml/
> (I'm using my blog as it allows me to better show code and example
> with nice layout and syntax highlighting!)
>
> I had to address some issue reported during MozCamp.
> JSON format was a bad idea, so I'm suggesting now to use YAML.
> This simple format seems to fit perfectly localization needs, while
> addressing issue of JSON.
>
>
> Again, please jump in the discussion if you have some feedback to
> share!
>
> On 10 nov, 19:44, Alexandre poirot<poirot.a...@gmail.com> wrote:
>> 2011/11/9 Mark Hammond<skippy.hamm...@gmail.com>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> On 10/11/2011 1:31 AM, Alexandre Poirot wrote:
>>
>>>> Le 9 nov. 2011 � 07:39, Mark Hammond<skippy.hamm...@gmail.com> a �crit :
http://blog.techno-barje.fr/post/2011/11/17/jetpack-localization-yaml/
pluralString:
one: "%s telechargement"
other: "%s telechargements"
I had wondered about choosing some editor-friendly format that we then
compile down to standards-compliant JSON when we run or package. The
packager would strip out comments and add newline characters, etc. We
could support YAML and package the YAML data into JSON.
We would be shipping a parser in the SDK, sure, but the packager would
be used by the YAML parser at build time, not by Firefox at runtime.
Jeff
I think YAML as an input format makes sense for people authoring in text
editors. I think JSON as the format that the SDK reads make sense (and
is trivial to generate from web authoring environments, etc.). Having a
simple tool to go from one to the other makes sense too.
--da
> We would be shipping a parser in the SDK, sure, but the packager would
> be used by the YAML parser at build time, not by Firefox at runtime.
Parsing YAML at build time still means landing and maintaining another
parser, even if we aren't doing the parsing at build time.
-myk
Looks great! And ( from what I remember of the discussion last weekend in Berlin ) this seems to cover the concerns people there had.
I assume there is some speed trade-off in parsing yaml vs JSON?
Real JSON ( as opposed to what the Mozilla codebase tolerates ) does not
support comments. If someone was going to create some other tool to
handle our particular JSON strain, they could not use JSON libraries in
other runtimes ( eg Python, PHP, etc )
>> We would be shipping a parser in the SDK, sure, but the packager would
>> be used by the YAML parser at build time, not by Firefox at runtime.
> Parsing YAML at build time still means landing and maintaining another
> parser, even if we aren't doing the parsing at build time.
That is definitely the draw-back.
On Thursday, 2011-11-17 at 10:56 , Myk Melez wrote:
On 2011-11-17 10:04 AM, Alexandre Poirot wrote:JSON format was a bad idea, so I'm suggesting now to use YAML.This simple format seems to fit perfectly localization needs, whileaddressing issue of JSON.A third option would be to use sanitized JS, i.e. something like JSONbut with explicit support for multiline strings and comments.
Thatavoids shipping yet another parser and dealing with YAML's variousintricacies (especially ones that don't obviously map to JSrepresentations, like mapping types that preserve key order) while stillenabling the features that localizers want and need.-myk
--You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To post to this group, send email to mozilla-la...@googlegroups.com.To unsubscribe from this group, send email to mozilla-labs-jet...@googlegroups.com.For more options, visit this group at http://groups.google.com/group/mozilla-labs-jetpack?hl=en.
On 11-11-17 1:54 PM, Myk Melez wrote:Real JSON ( as opposed to what the Mozilla codebase tolerates ) does not support comments. If someone was going to create some other tool to handle our particular JSON strain, they could not use JSON libraries in other runtimes ( eg Python, PHP, etc )
On 2011-11-17 1:49 PM, Jeff Griffiths wrote:
I had wondered about choosing some editor-friendly format that we thenIndeed, but we could also just use JSON with comments.
compile down to standards-compliant JSON when we run or package. The
packager would strip out comments and add newline characters, etc. We
could support YAML and package the YAML data into JSON.
You are right, we will have to ship property files in the final XPI,
but they can be generated automatically, like install.rdf.