Gettext for Elixir - getting serious at compile time
summary
Gettext for Elixir claims most work moves to compile time and demonstrates it concretely: macros generate function clauses per translation from .po templates, extraction runs via mix gettext.extract, merges via mix gettext.merge, and an agent during compilation collects source references so translators get context. Result is zero runtime cost, support for interpolation and plural rules (Arabic needs six forms), published on Hex, requires Elixir 1.1, and the library already builds and runs fast in real projects.
AI-written summary · about
chapters (33)
- 0:00Intro
- 0:48Metaprogramming
- 1:36Agents
- 2:16What is Gettext
- 5:21English strings
- 6:49More context
- 7:38Simple syntax
- 8:11Poedit
- 9:58Read translations from p0 files
- 10:26Dynamic function clauses
- 11:48Move logic away from runtime
- 12:09The compiler is your friend
- 14:13Gitex tooling
- 15:03Rewriting macros
- 15:36Extract translations
- 15:51Attack macro
- 16:29Extract translation
- 17:00Push to an agent
- 18:10Implementation
- 18:54Runtime cost
- 19:18Compile time
- 19:47curly bracket syntax
- 20:32law realization
- 21:06Plural form
- 22:09Gettext workflow
- 22:23Define a text module
- 22:41Wrap the strings
- 23:01Gettexturedistract
- 23:30Translations
- 24:49Update Source Code
- 25:54Fuzzy Matching
- 26:46Getting text to work
- 27:02Summary
related talks
40mIntelliJ Elixir Works Even if your Code Doesn't
40mIntelliJ Elixir Works Even if your Code Doesn't
01h 00mKeynote: Elixir
45mWhat Elixir is about
32mThe Excitement of Elixir
28mCode Spelunking for Knowledge and Profit
36mRefactoring Elixir - Lessons Learned from a Year on
27mParsing, Compiling, and Static Metaprogramming
