Closed fabricedesre closed 10 years ago
Excellent point! @fabricedesre , would you recommend webl10n?
For now yes. There's an ongoing effort to move gaia to l20n but it's not ready yet and will be quite similar in terms of APIs.
I think @basta had mentioned that webl10n did not have support for attributes, IIRC. So things like placeholders wouldn't get localized. But, I really don't remember.
I would be surprised. You can check with @fabi1cazenave to be sure.
webL10n supports attributes, and it’s rather simple:
<input type="text" data-l10n-id="userName" />
and in your *.en-US.properties file, just add:
userName.placeholder = User name…
Oh perfect, thanks @fabi1cazenave !
Need to add placeholders
@fabi1cazenave , I'm seeing a CSP warning in the app validator. Does webl10n violate CSP for privileged apps?
@fabi1cazenave , should I be using webL10n from gaia instead?
@nickdesaulniers the main difference between Gaia’s l10n.js library and the one in webL10n is that the latter is cross-browser — hence a slightly different API and a few fallbacks for IE<9. In other words:
Hope this helps!
@fabi1cazenave , great info, I added it to webl10n's wiki.
Great, thanks!
Correct me if I'm wrong, but I see no l10n infrastructure in this code.