Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
I18n Alchemy
Search
Plataformatec
August 30, 2012
Programming
25k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
I18n Alchemy
Lightning Talk por Lucas Mazza, na RubyConf Brasil 2012.
Plataformatec
August 30, 2012
More Decks by Plataformatec
See All by Plataformatec
O case da Plataformatec com o Elixir - Como uma empresa brasileira criou uma linguagem que é usada no mundo inteiro @ Elixir Brasil 2019
plataformatec
5
1.2k
O case da Plataformatec com o Elixir - Como uma empresa brasileira criou uma linguagem que é usada no mundo inteiro @ QCon SP 2018
plataformatec
1
270
Elixir @ iMasters Intercon 2016
plataformatec
1
290
GenStage and Flow by @josevalim at ElixirConf
plataformatec
17
2.9k
Elixir: Programação Funcional e Pragmática @ 2º Tech Day Curitiba
plataformatec
2
350
Elixir: Programação Funcional e Pragmática @ Encontro Locaweb 2016
plataformatec
4
330
What's ahead for Elixir: v1.2 and GenRouter
plataformatec
15
2.2k
Arquiteturas Comuns de Apps Rails @ RubyConf BR 2015
plataformatec
6
410
Pirâmide de testes, escrevendo testes com qualidade @ RubyConf 2015
plataformatec
10
2.6k
Other Decks in Programming
See All in Programming
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
140
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.9k
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
1k
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
150
[DroidKaigi 2026] Bring your own phones to Gradle Managed Devices
f2lk
0
110
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
180
信頼性の目標を誰も求めてない
shubox
0
500
Deep dive into the select statement (GopherCon UK)
jespino
0
170
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
5.7k
Laravelのアプリケーションをどこにデプロイするか #ツナギメオフライン.9
akase244
0
120
AIエージェント時代のコードレビューを設計する
nogu66
6
2.6k
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
3
280
Featured
See All Featured
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
620
Documentation Writing (for coders)
carmenintech
77
5.5k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
350
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
WCS-LA-2024
lcolladotor
0
820
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
680
Docker and Python
trallard
47
4.2k
Are puppies a ranking factor?
jonoalderson
2
3.9k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
300
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
We Have a Design System, Now What?
morganepeng
55
8.3k
Why Our Code Smells
bkeepers
PRO
340
58k
Transcript
I18nAlchemy
@lucasmazza
None
datas, números e valores • DD/MM/YYYY ➜ MM/DD/YYYY • 1.5
➜ 1.50 • 1,000.00 ➜ 1000.00
Rails + i18n l(@event.starts_at, :format => :short) # '30 de
Agosto' number_with_precision(1200.3) # '1,200.30'
@event.starts_at = '30/08/2012' @event.starts_at # nil
lol no @event.starts_at = '30/08/2012' @event.starts_at # nil
gem install i18n-alchemy
@cantoniodasilva
@cantoniodasilva señor developer @ plataformatec
@cantoniodasilva señor developer @ plataformatec “ENTENDENDO E TIRANDO O MELHOR
DO RAILS ACTIVE MODEL” 11h @ Sala 2
class Event < ActiveRecord::Base include I18n::Alchemy localize :starts_at, :ends_at, :price
end I18nAlchemy
class Event < ActiveRecord::Base include I18n::Alchemy localize :starts_at, :ends_at, :price
end I18nAlchemy
I18n.with_locale :pt do @event.localized.starts_at = '30/08/2012' @event.starts_at # => Date.new(2012,
08, 30) @event.localized.starts_at # => '30/08/2012' @event.localized.price = '150,00' @event.localized.starts_at = 3.days.ago @event.save! end I18nAlchemy
.localized?
.localized? • I18n::Alchemy::Proxy
.localized? • I18n::Alchemy::Proxy • Nada de sobreescrever acessores
.localized? • I18n::Alchemy::Proxy • Nada de sobreescrever acessores • Manipula
apenas os atributos configurados
I18nAlchemy class Product < ActiveRecord::Base include I18n::Alchemy localize :total, :using
=> :number def total quantity * price end end
I18nAlchemy • Configurações através do i18n • Não é dependente
do ActiveRecord • Escreva os seus próprios parsers!
module MyParser def self.parse(value) # ... end def self.localize(value) #
... end end class Product < ActiveRecord::Base include I18n::Alchemy localize :total, :using => MyParser end
Para pull requests, issues, declarações de amor e afins: https://github.com/carlosantoniodasilva/i18n_alchemy
Obrigado!