SlideShare a Scribd company logo
1 of 14
Download to read offline
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

More Related Content

What's hot

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
 

What's hot (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 к лямбдам, Андрей Родионов
 

Viewers also liked

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
 

Viewers also liked (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 to 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 to 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
 

More from 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.
 

More from 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
 

Recently uploaded

Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

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