Successfully reported this slideshow.
Your SlideShare is downloading. ×

Fast Gettext

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
Spec & Test Helper
Spec & Test Helper
Loading in …3
×

Check these out next

1 of 12 Ad

More Related Content

Similar to Fast Gettext (20)

Recently uploaded (20)

Advertisement

Fast Gettext

  1. 1. FastGettext
  2. 2. Hello my name is <ul><li>Michael Grosser </li></ul><ul><li>Rathershort.com </li></ul>
  3. 3. FastSimpleCleanSafeGettext
  4. 4. FastGettext – GetText <ul><li>GetText is a pile of spaghetticode </li></ul><ul><li>Entagled with AR/Rails/X </li></ul><ul><li>namespace: 34 vs 7 </li></ul><ul><li>9.17 times slower than FastGettext </li></ul><ul><li>2884 KB larger </li></ul>
  5. 5. FastGettext – Why use it? <ul><li>_('Hello!') </li></ul><ul><li>Simpler, Safer, Faster, more Maintainable then t('view.messages.greeting.friendly') </li></ul>
  6. 6. FastGettext – Simple? <ul><li>Readable & clean code </li></ul><ul><li>Automatic translation finding (parsing + tests) </li></ul><ul><li>No defaults needed </li></ul>
  7. 7. FastGettext – Safe? <ul><li>No ”No translation found” for users, ever! </li></ul><ul><li>Always fallback to en </li></ul><ul><li>No fuzzy translations </li></ul><ul><li>No obsolete translations </li></ul>
  8. 8. FastGettext – Fast? <ul><li>18 times faster </li></ul><ul><li>Small footprint: 0.136mb vs 7.12mb </li></ul><ul><li>Custom backends (.mo/.po/.yml/database...) </li></ul>
  9. 9. FastGettext – Maintainable <ul><li>Code is readable, no parallel yml lookup </li></ul><ul><li>If it is tested, translation is known </li></ul><ul><li>If it is not tested, everyone can see </li></ul>
  10. 10. FastGettext – When not to use <ul><li>Building plugins </li></ul><ul><li>Building huge frameworks others use </li></ul>
  11. 11. FastGettext – Syntax <ul><li>_('Hello %{name}') % :name=>user.name </li></ul><ul><li>_('available'): x n_('apple','apples',x) </li></ul><ul><li>s_('Car|Name') <-> s_('User|Name') </li></ul>
  12. 12. FastGettext – gettext_i18n_rails <ul><li>DEMO </li></ul>

×