Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Localization Revisted (aka. Translations Evolve...
Search
PyCon 2014
April 13, 2014
Technology
0
720
Localization Revisted (aka. Translations Evolved) by Ruchi Varshney
PyCon 2014
April 13, 2014
Tweet
Share
More Decks by PyCon 2014
See All by PyCon 2014
Postgres Performance for Humans by Craig Kerstiens
pycon2014
29
3.7k
Technical Onboarding, Training, and Mentoring by Kate Heddleston and Nicole Zuckerman
pycon2014
1
2.4k
"My big gay adventure. Making, releasing and selling an indie game made in python." by Luke Miller
pycon2014
2
1.6k
Farewell and Welcome Home, Python in Two Genders by Naomi_Ceder
pycon2014
1
770
Deliver Your Software in an Envelope by Augie Fackler and Nathaniel Manista
pycon2014
1
590
Hitchhikers Guide to Free and Open Source Participation by Elena Williams
pycon2014
6
1.2k
Smart Dumpster by Bradley E. Angell
pycon2014
0
550
Software Engineering for Hackers: Bridging the Two Solitudes by Tavish Armstrong
pycon2014
0
770
Outreach Program for Women: Lessons in Collaboration by Marina Zhurakhinskaya
pycon2014
0
590
Other Decks in Technology
See All in Technology
なぜCREを8年間続けているのか / cre-camp-4-2026-01-21
missasan
0
960
OCI技術資料 : OS管理ハブ 概要
ocise
2
4.2k
エンジニアとして長く走るために気づいた2つのこと_大賀愛一郎
nanaism
0
210
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
Data Hubグループ 紹介資料
sansan33
PRO
0
2.6k
Git Training GitHub
yuhattor
1
220
Databricks Free Edition講座 データエンジニアリング編
taka_aki
0
2.7k
習慣とAIと環境 — 技術探求を続ける3つの鍵
azukiazusa1
2
690
クラウドセキュリティの進化 — AWSの20年を振り返る
kei4eva4
0
150
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
17k
20260120 Amazon VPC のパブリックサブネットを無くしたい!
masaruogura
2
140
2026/01/16_実体験から学ぶ 2025年の失敗と対策_Progate Bar
teba_eleven
1
210
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.5k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
89
Docker and Python
trallard
47
3.7k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
800
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
49
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
71
Accessibility Awareness
sabderemane
0
38
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
49
The Spectacular Lies of Maps
axbom
PRO
1
440
Transcript
translations evolved ruchi varshney pycon 2014
about me @rvarshney on the web
None
most common tools are gettext and babel ! import gettext
as _ print _("Translate me.") ! from babel import dates, numbers dates.format_datetime(date, locale='de') numbers.format_decimal(1.234, locale='de') ! ! basics
! # Extraction config file (babel.cfg) [python: **.py] [jinja2: **.html]
[javascript: **.js] ! [extractors] python = babel.messages.extract:extract_python jinja2 = jinja2.ext:babel_extract javascript = babel.messages.extract:extract_javascript ! ! basics
# Run extraction $ pybabel extract --mapping-file babel.cfg --output out.po
<source_dir> ! ! ! ! ! basics
! # Translations for MYAPP. # Copyright (c) 2014 ORGANIZATION
! #: app/views.py:20 #, python-format msgid "Translate me." msgstr "" ! ! basics
basics _("hello!") msgid "hello!" bonjour! translation service message.mo extract compile
integrate
what could possibly go wrong?
latency
! def greeting(name, is_welcome): if is_welcome: return _("Hey there!") else:
return _("Bye Bye") ! ! ! strings before logic
! class Greetings(object): WELCOME_MESSAGE = _("Hey there!") BYE_MESSAGE = _("Bye!")
! ! def greeting(name, is_welcome): if is_welcome: return Greetings.WELCOME_MESSAGE else: return Greetings.BYE_MESSAGE strings before logic
! class Greetings(object): WELCOME_MESSAGE = _("Hey there!”) BYE_MESSAGE = _("Bye!")
BYE_MESSAGE = _("See you later!") ! ! ! ! ! lost in translation
! #, python-format msgid "Bye!" msgstr "Au revoir!" ! #,
python-format msgid "See you later!" msgstr "" ! lost in translation
lost in translation
hooks https://17727.web.pr.dev.hearsaylabs.com/
! class Greetings(object): WELCOME_MESSAGE = _("Hey there!”) BYE_MESSAGE = _("Bye!")
NEW_BYE_MESSAGE = _("See you later!") ! ! ! ! ! lost in translation
babel gotchas #: app/views.py:20 #, python-format #, fuzzy msgid "Translate
them." msgstr "Traduisez-moi"
babel gotchas “strings might be marked as fuzzy — if
you have fuzzy entries, make sure to check them by hand and remove the fuzzy flag before compiling.”
• —no-fuzzy-matching • other useful ones • —ignore-obsolete True •
—add-comments TRANSLATOR: • —keyword "_lazy" babel flags
• find the last translation date • run string extraction
• send po file for translation • wait… • get translations back • integrate with app • …. mundane dev
automation jenkins/travis translation upload translation download
dev intervention
content management
content management developer friendly apis translator friendly continuous, cross platform
• sample code • https://github.com/rvarshney/translations • how to i18n and
l10n (pycon 2013) • http://bit.ly/pyconi18n • https://www.youtube.com/watch?v=QUFPPJMjn6k resources
• python packages and tools • gettext, babel, potpie, polib
• githooks, webhooks, jenkins, travis • content management • smartling, transifex have known python support • django-rosetta (open source) resources
questions? @rvarshney we’re hiring!