Fast Gettext

1,853 views

Published on

FastGettext is ruby GetText but 9.17 times faster, simple, clean namespace (7 vs 34), threadsave, Rails 2.2+ ready.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,853
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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>

×