Thanks Wes, I hadn't seen that before. I'm only somewhat familiar with
json, but working from the simple-prefs documentation, it looks like I
would just paste in code in the following format to get a single string
preference, is that right?
"preferences": [{
"name": "somePreference",
"title": "Some preference
title",
"type": "string",
"value": "this is the default string value"
}]
And if I wanted to have 3 preferences, one of each type, would this do
it?
"preferences": [{
"name": "somePreference",
"title": "Some preference
title",
"type": "string",
"value": "this is the default string value"
},
{
"name": "integerPreference",
"title": "Integer preference
title",
"type": "integer",
"value": 10
},
{
"name": "booleanPreference",
"title": "Boolean preference
title",
"type": "boolean",
"value": false
}]
The accepted values for "type" are not listed on the simple-prefs
documentation page. I'm assuming they are "string" "integer" and
"boolean". At first I was tempted to put quotes around my boolean and
integer values (
"false" and "10"), but then reminded myself
that json is just js, and that would make them strings. It might be
worth having one of each type in the example code on that page, for
folks (ok, noobs...) like me who aren't so familiar with json.
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/addon-kit/simple-prefs.html
Localization looks a little trickier since the documentation talks about
creating separate locale files and then the
"SDK tools compile
the locale files into a JSON format when
producing an XPI."
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/tutorials/l10n.html
I looked here but didn't see anything on localization:
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/package-spec.html
So I'm not sure what the resulting json localization code would need to
look like, in order for it to go directly into the package.json file via
builder. Or should I be working with localization files rather than
json on this?
I can always wait on localization if I'm getting ahead of things here.
Thanks again,
-Paul