SlideShare una empresa de Scribd logo
1 de 14
Descargar para leer sin conexión
Crossing the borders:
         the i18n system




Lorenzo Mancini (lmancini@develer.com)
What is i18n about?
   Embracing a specific national
    environment:
          Language
          Line break behaviour
          Writing direction
          Conventions
   ...without hampering development
(True) Horror Story




We're in 2002, and a big Italian company wants
 to localize their CAD program in Spanish.

             If only it wasn't for...
(True) Horror Story
   Strings were initially hardcoded in Italian,
    English was retrofitted at some point...
   ...with lots of if/else statements
   First try: add another else branch for each
    string in code (...)
   Second try: tool to produce multiple
    codebases – one for each language (...)
   AFAIK still unfinished two years later
All we need is a good workflow
   Developers produce i18n-ready code
          With no codebase pollution
   Translators translate strings
          Iteratively (code and strings can change!)
          No technical knowledge needed
   The framework does the rest
Developers' step 1
   QObject::tr()
       Parse-time: marks strings
       Run-time: translates strings
   Not everything is a QObject...
       QCoreApplication::translate()
       QT_TR_NOOP



                                        6
Developers' step 2
   Use QString for all user visible text
   QString are Unicode strings → transparent
    processing of strings (reg exp, split etc)
   Programmer space strings can still be
    QByteArrays or char *




                                             7
Developers' step 3
   Use QString::arg() for dynamic text
   QString::arg() allows easy argument
    reordering


    void FileCopier::showProgress(int done, int total, const
    QString &currentFile)
    {
         label.setText(tr("%1 of %2 files copied.nCopying: %3")
               .arg(done)
               .arg(total)
               .arg(currentFile));
    }


                                                                   8
Some glue
   Add a TRANSLATIONS entry to .pro
   Run lupdate to extract a .ts file
   Send .ts file to translators
   Run lrelease to produce translated binary
    files
   Set up a QTranslator
   QCoreApplication::installTranslator()



                                                9
Translators' (only) step
   Open .ts file with Linguist
   Fill the missing translations
   There is no step 3


   Developer: “...hey that's not fair!”




                                           10
Some case studies
   Nearing the 2.0 release:
          Parse again with lupdate
          Fill only the missing translations
   Wanting to add a language
          Add that language to TRANSLATIONS
          Run lupdate, translate the new .ts file, lrelease
          This time it's a fairy tale!
   Update language on the fly
          installTranslator sends a changeEvent
                                                               11
Workflow demo




                12
Gotchas
   ::tr assumes latin-1
   What about Designer files?




                                 13
THANKS !
                                Develer S.r.l.
                             Via Mugellese 1/A
                         50013 Campi Bisenzio
                                 Firenze - Italy




Contacts
Mail: info@develer.com
Phone: +39-055-3984627
Fax: +39 178 6003614
http://www.develer.com

Más contenido relacionado

La actualidad más candente

Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)Ivan Čukić
 
Yet another introduction to Linux RCU
Yet another introduction to Linux RCUYet another introduction to Linux RCU
Yet another introduction to Linux RCUViller Hsiao
 
Stackless Python In Eve
Stackless Python In EveStackless Python In Eve
Stackless Python In Eveguest91855c
 
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....AboutYouGmbH
 
NIR on the Mesa i965 backend (FOSDEM 2016)
NIR on the Mesa i965 backend (FOSDEM 2016)NIR on the Mesa i965 backend (FOSDEM 2016)
NIR on the Mesa i965 backend (FOSDEM 2016)Igalia
 
FreeRTOS Xilinx Vivado: Hello World!
FreeRTOS Xilinx Vivado: Hello World!FreeRTOS Xilinx Vivado: Hello World!
FreeRTOS Xilinx Vivado: Hello World!Vincent Claes
 
Traitement temps réel chez Streamroot - Golang Paris Juin 2016
Traitement temps réel chez Streamroot - Golang Paris Juin 2016Traitement temps réel chez Streamroot - Golang Paris Juin 2016
Traitement temps réel chez Streamroot - Golang Paris Juin 2016Simon Caplette
 
Clockless design language - ilia greenblat
Clockless design language - ilia greenblatClockless design language - ilia greenblat
Clockless design language - ilia greenblatchiportal
 
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...Takuo Watanabe
 
От Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей РодионовОт Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей РодионовYandex
 

La actualidad más candente (20)

2011.jtr.pbasanta.
2011.jtr.pbasanta.2011.jtr.pbasanta.
2011.jtr.pbasanta.
 
Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)
 
S emb t13-freertos
S emb t13-freertosS emb t13-freertos
S emb t13-freertos
 
lec9_ref.pdf
lec9_ref.pdflec9_ref.pdf
lec9_ref.pdf
 
Yet another introduction to Linux RCU
Yet another introduction to Linux RCUYet another introduction to Linux RCU
Yet another introduction to Linux RCU
 
Java 7 & 8
Java 7 & 8Java 7 & 8
Java 7 & 8
 
Stackless Python In Eve
Stackless Python In EveStackless Python In Eve
Stackless Python In Eve
 
Parallel R
Parallel RParallel R
Parallel R
 
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
 
No Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time JavaNo Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time Java
 
RCU
RCURCU
RCU
 
NIR on the Mesa i965 backend (FOSDEM 2016)
NIR on the Mesa i965 backend (FOSDEM 2016)NIR on the Mesa i965 backend (FOSDEM 2016)
NIR on the Mesa i965 backend (FOSDEM 2016)
 
FreeRTOS Xilinx Vivado: Hello World!
FreeRTOS Xilinx Vivado: Hello World!FreeRTOS Xilinx Vivado: Hello World!
FreeRTOS Xilinx Vivado: Hello World!
 
Extending ns
Extending nsExtending ns
Extending ns
 
Traitement temps réel chez Streamroot - Golang Paris Juin 2016
Traitement temps réel chez Streamroot - Golang Paris Juin 2016Traitement temps réel chez Streamroot - Golang Paris Juin 2016
Traitement temps réel chez Streamroot - Golang Paris Juin 2016
 
Enhancing the region model of RTSJ
Enhancing the region model of RTSJEnhancing the region model of RTSJ
Enhancing the region model of RTSJ
 
2017 10 17_quantum_program_v2
2017 10 17_quantum_program_v22017 10 17_quantum_program_v2
2017 10 17_quantum_program_v2
 
Clockless design language - ilia greenblat
Clockless design language - ilia greenblatClockless design language - ilia greenblat
Clockless design language - ilia greenblat
 
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
 
От Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей РодионовОт Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей Родионов
 

Destacado

Cloud computing, in practice ~ develer workshop
Cloud computing, in practice ~ develer workshopCloud computing, in practice ~ develer workshop
Cloud computing, in practice ~ develer workshopDeveler S.r.l.
 
BeRTOS Embedded Survey Summary 2011
BeRTOS Embedded Survey Summary 2011BeRTOS Embedded Survey Summary 2011
BeRTOS Embedded Survey Summary 2011Develer S.r.l.
 
Trace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linux
Trace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linuxTrace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linux
Trace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linuxDeveler S.r.l.
 
Digital to analog convertor
Digital to analog convertorDigital to analog convertor
Digital to analog convertorsartaj ahmed
 

Destacado (7)

Cloud computing, in practice ~ develer workshop
Cloud computing, in practice ~ develer workshopCloud computing, in practice ~ develer workshop
Cloud computing, in practice ~ develer workshop
 
Engagement small
Engagement smallEngagement small
Engagement small
 
BeRTOS Embedded Survey Summary 2011
BeRTOS Embedded Survey Summary 2011BeRTOS Embedded Survey Summary 2011
BeRTOS Embedded Survey Summary 2011
 
Trace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linux
Trace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linuxTrace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linux
Trace32 lo-strumento-piu-completo-per-il-debug-di-un-sistema-linux
 
Farepipi
FarepipiFarepipi
Farepipi
 
Digital to analog convertor
Digital to analog convertorDigital to analog convertor
Digital to analog convertor
 
Sw libero rf
Sw libero rfSw libero rf
Sw libero rf
 

Similar a Crossing the border with Qt: the i18n system

Internazionalizza le tue applicazioni
Internazionalizza le tue applicazioniInternazionalizza le tue applicazioni
Internazionalizza le tue applicazioniQT-day
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...IndicThreads
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftTalentica Software
 
Translating Qt Applications
Translating Qt ApplicationsTranslating Qt Applications
Translating Qt Applicationsaccount inactive
 
Qt Internationalization
Qt InternationalizationQt Internationalization
Qt InternationalizationICS
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughgabriellekuruvilla
 
Linux and Localization Tutorial Paras pradhan Senior Linux ...
Linux and Localization Tutorial Paras pradhan Senior Linux ...Linux and Localization Tutorial Paras pradhan Senior Linux ...
Linux and Localization Tutorial Paras pradhan Senior Linux ...webhostingguy
 
Os Worthington
Os WorthingtonOs Worthington
Os Worthingtonoscon2007
 
Cmp2412 programming principles
Cmp2412 programming principlesCmp2412 programming principles
Cmp2412 programming principlesNIKANOR THOMAS
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For ManagersAtul Shridhar
 
(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_netNico Ludwig
 
What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...Sławomir Zborowski
 
Experience with C++11 in ArangoDB
Experience with C++11 in ArangoDBExperience with C++11 in ArangoDB
Experience with C++11 in ArangoDBMax Neunhöffer
 
python presentation
python presentationpython presentation
python presentationVaibhavMawal
 
Python Course Basic
Python Course BasicPython Course Basic
Python Course BasicNaiyan Noor
 
Pharo 2.0: An Exciting Milestone
Pharo 2.0: An Exciting MilestonePharo 2.0: An Exciting Milestone
Pharo 2.0: An Exciting MilestoneMarcus Denker
 

Similar a Crossing the border with Qt: the i18n system (20)

Internazionalizza le tue applicazioni
Internazionalizza le tue applicazioniInternazionalizza le tue applicazioni
Internazionalizza le tue applicazioni
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thrift
 
Translating Qt Applications
Translating Qt ApplicationsTranslating Qt Applications
Translating Qt Applications
 
MODULE 1.pptx
MODULE 1.pptxMODULE 1.pptx
MODULE 1.pptx
 
Qt Internationalization
Qt InternationalizationQt Internationalization
Qt Internationalization
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
Linux and Localization Tutorial Paras pradhan Senior Linux ...
Linux and Localization Tutorial Paras pradhan Senior Linux ...Linux and Localization Tutorial Paras pradhan Senior Linux ...
Linux and Localization Tutorial Paras pradhan Senior Linux ...
 
Os Worthington
Os WorthingtonOs Worthington
Os Worthington
 
Cmp2412 programming principles
Cmp2412 programming principlesCmp2412 programming principles
Cmp2412 programming principles
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For Managers
 
(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net
 
What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...
 
Experience with C++11 in ArangoDB
Experience with C++11 in ArangoDBExperience with C++11 in ArangoDB
Experience with C++11 in ArangoDB
 
Chapter - 1.pptx
Chapter - 1.pptxChapter - 1.pptx
Chapter - 1.pptx
 
python presentation
python presentationpython presentation
python presentation
 
Intermediate Languages
Intermediate LanguagesIntermediate Languages
Intermediate Languages
 
Python Course Basic
Python Course BasicPython Course Basic
Python Course Basic
 
Python lecture 02
Python lecture 02Python lecture 02
Python lecture 02
 
Pharo 2.0: An Exciting Milestone
Pharo 2.0: An Exciting MilestonePharo 2.0: An Exciting Milestone
Pharo 2.0: An Exciting Milestone
 

Más de Develer S.r.l.

Workshop su Android Kernel Hacking
Workshop su Android Kernel HackingWorkshop su Android Kernel Hacking
Workshop su Android Kernel HackingDeveler S.r.l.
 
Qt roadmap: the future of Qt
Qt roadmap: the future of QtQt roadmap: the future of Qt
Qt roadmap: the future of QtDeveler S.r.l.
 
Qt Quick for dynamic UI development
Qt Quick for dynamic UI developmentQt Quick for dynamic UI development
Qt Quick for dynamic UI developmentDeveler S.r.l.
 
Qt licensing: making the right choice
Qt licensing: making the right choiceQt licensing: making the right choice
Qt licensing: making the right choiceDeveler S.r.l.
 
Qt Creator: the secret weapon of any c++ programmer
Qt Creator: the secret weapon of any c++ programmerQt Creator: the secret weapon of any c++ programmer
Qt Creator: the secret weapon of any c++ programmerDeveler S.r.l.
 
PyQt: rapid application development
PyQt: rapid application developmentPyQt: rapid application development
PyQt: rapid application developmentDeveler S.r.l.
 
Hybrid development using Qt webkit
Hybrid development using Qt webkitHybrid development using Qt webkit
Hybrid development using Qt webkitDeveler S.r.l.
 
Smashing the bottleneck: Qt application profiling
Smashing the bottleneck: Qt application profilingSmashing the bottleneck: Qt application profiling
Smashing the bottleneck: Qt application profilingDeveler S.r.l.
 
BeRTOS: Sistema Real Time Embedded Free
BeRTOS: Sistema Real Time Embedded FreeBeRTOS: Sistema Real Time Embedded Free
BeRTOS: Sistema Real Time Embedded FreeDeveler S.r.l.
 
BeRTOS: Free Embedded RTOS
BeRTOS: Free Embedded RTOSBeRTOS: Free Embedded RTOS
BeRTOS: Free Embedded RTOSDeveler S.r.l.
 
Develer - Company Profile
Develer - Company ProfileDeveler - Company Profile
Develer - Company ProfileDeveler S.r.l.
 
Bettersoftware Feedback 2009
Bettersoftware Feedback 2009Bettersoftware Feedback 2009
Bettersoftware Feedback 2009Develer S.r.l.
 
Develer - Qt Embedded - Introduzione
Develer - Qt Embedded - Introduzione Develer - Qt Embedded - Introduzione
Develer - Qt Embedded - Introduzione Develer S.r.l.
 

Más de Develer S.r.l. (13)

Workshop su Android Kernel Hacking
Workshop su Android Kernel HackingWorkshop su Android Kernel Hacking
Workshop su Android Kernel Hacking
 
Qt roadmap: the future of Qt
Qt roadmap: the future of QtQt roadmap: the future of Qt
Qt roadmap: the future of Qt
 
Qt Quick for dynamic UI development
Qt Quick for dynamic UI developmentQt Quick for dynamic UI development
Qt Quick for dynamic UI development
 
Qt licensing: making the right choice
Qt licensing: making the right choiceQt licensing: making the right choice
Qt licensing: making the right choice
 
Qt Creator: the secret weapon of any c++ programmer
Qt Creator: the secret weapon of any c++ programmerQt Creator: the secret weapon of any c++ programmer
Qt Creator: the secret weapon of any c++ programmer
 
PyQt: rapid application development
PyQt: rapid application developmentPyQt: rapid application development
PyQt: rapid application development
 
Hybrid development using Qt webkit
Hybrid development using Qt webkitHybrid development using Qt webkit
Hybrid development using Qt webkit
 
Smashing the bottleneck: Qt application profiling
Smashing the bottleneck: Qt application profilingSmashing the bottleneck: Qt application profiling
Smashing the bottleneck: Qt application profiling
 
BeRTOS: Sistema Real Time Embedded Free
BeRTOS: Sistema Real Time Embedded FreeBeRTOS: Sistema Real Time Embedded Free
BeRTOS: Sistema Real Time Embedded Free
 
BeRTOS: Free Embedded RTOS
BeRTOS: Free Embedded RTOSBeRTOS: Free Embedded RTOS
BeRTOS: Free Embedded RTOS
 
Develer - Company Profile
Develer - Company ProfileDeveler - Company Profile
Develer - Company Profile
 
Bettersoftware Feedback 2009
Bettersoftware Feedback 2009Bettersoftware Feedback 2009
Bettersoftware Feedback 2009
 
Develer - Qt Embedded - Introduzione
Develer - Qt Embedded - Introduzione Develer - Qt Embedded - Introduzione
Develer - Qt Embedded - Introduzione
 

Último

Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdfMuhammad Subhan
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideStefan Dietze
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 

Último (20)

Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 

Crossing the border with Qt: the i18n system

  • 1. Crossing the borders: the i18n system Lorenzo Mancini (lmancini@develer.com)
  • 2. What is i18n about?  Embracing a specific national environment:  Language  Line break behaviour  Writing direction  Conventions  ...without hampering development
  • 3. (True) Horror Story We're in 2002, and a big Italian company wants to localize their CAD program in Spanish. If only it wasn't for...
  • 4. (True) Horror Story  Strings were initially hardcoded in Italian, English was retrofitted at some point...  ...with lots of if/else statements  First try: add another else branch for each string in code (...)  Second try: tool to produce multiple codebases – one for each language (...)  AFAIK still unfinished two years later
  • 5. All we need is a good workflow  Developers produce i18n-ready code  With no codebase pollution  Translators translate strings  Iteratively (code and strings can change!)  No technical knowledge needed  The framework does the rest
  • 6. Developers' step 1  QObject::tr()  Parse-time: marks strings  Run-time: translates strings  Not everything is a QObject...  QCoreApplication::translate()  QT_TR_NOOP 6
  • 7. Developers' step 2  Use QString for all user visible text  QString are Unicode strings → transparent processing of strings (reg exp, split etc)  Programmer space strings can still be QByteArrays or char * 7
  • 8. Developers' step 3  Use QString::arg() for dynamic text  QString::arg() allows easy argument reordering void FileCopier::showProgress(int done, int total, const QString &currentFile) { label.setText(tr("%1 of %2 files copied.nCopying: %3") .arg(done) .arg(total) .arg(currentFile)); } 8
  • 9. Some glue  Add a TRANSLATIONS entry to .pro  Run lupdate to extract a .ts file  Send .ts file to translators  Run lrelease to produce translated binary files  Set up a QTranslator  QCoreApplication::installTranslator() 9
  • 10. Translators' (only) step  Open .ts file with Linguist  Fill the missing translations  There is no step 3  Developer: “...hey that's not fair!” 10
  • 11. Some case studies  Nearing the 2.0 release:  Parse again with lupdate  Fill only the missing translations  Wanting to add a language  Add that language to TRANSLATIONS  Run lupdate, translate the new .ts file, lrelease  This time it's a fairy tale!  Update language on the fly  installTranslator sends a changeEvent 11
  • 13. Gotchas  ::tr assumes latin-1  What about Designer files? 13
  • 14. THANKS ! Develer S.r.l. Via Mugellese 1/A 50013 Campi Bisenzio Firenze - Italy Contacts Mail: info@develer.com Phone: +39-055-3984627 Fax: +39 178 6003614 http://www.develer.com