kc-dot-io / Mojo-Mobile

Mojo-Mobile
http://blastmojo.com
Other
2 stars 0 forks source link

Implement a shorthand of fetching localization values #3

Closed jbueza closed 9 years ago

jbueza commented 13 years ago

Seems more DRY to probably go like this:

text: Mojo.L('btnOk');

Primarily inspired by addon developers who write localized versions on Chrome and Firefox.

kc-dot-io commented 13 years ago

Hmm, that seems a little too DRY to me. One of the major things I want to achieve with this play on Mojo is that the syntax is very obvious and explanatory. I didn't find original Mojo had that going for it.

Mojo.L isn't very subjective although I know it is widely used.

I was thinking something like Mojo.Loc() or Mojo.i18n() would probably be a little more clear to our user base who mostly don't experiment with as mature frameworks like Chrome / Firefox devs would.

jbueza commented 13 years ago

+1 for Mojo.i18n(). For examples, do you want to set the best practices to have a shorthand like this?

var L = Mojo.i18n;

//...code for view
text: L('btnOk');
kc-dot-io commented 13 years ago

I'm more used to _() or __() which is what is used in most PHP platforms. Symfony, Wordpress, Cake etc.

Have you used that at all?

jbueza commented 13 years ago

That might with the underscore dudes: http://documentcloud.github.com/underscore/ but I'm not sure if people will be using Underscore inside appcelerator. __ shorthand does seem easier!