SlideShare a Scribd company logo
1 of 45
Download to read offline
Localization testing
with compare-locales and Silme


by Adrian Kalla
Me

●   Computer Science studies in
     Wuerzburg/Germany
●   Member of the Polish Mozilla-L10n-Community
     since 2002/2003
●   Internship@MoCo: August-December 2008
Why do we need L10n-tests?

●   Localizers:
       –   to easily find possible problems

●   Developers:
       –   to make sure a localization does not break
             everything
Silme & compare-locales

●   Silme is a new localization library written in
      Python

●   Compare-locales is a tool for testing the
     completeness and correctness of
     localizations
The world before Silme

●   Mozilla Translator
●   Narro
●   Translate Toolkit
●   Litmus
●   compare-locales
●   and much more...
Mozilla Translator

●   Probably the
     oldest tool for
     Mozilla L10n
●   Still maintained
●   Causes some
     problems with
     file layout
Narro

●   Powerful
     localization tool
●   Translation
      suggestions
●   Language pack
     creation
●   Web-only
Translate Toolkit

●   Collection of many small tools
●   Main goal: convert every L10n file to PO to
     work with every L10n-Tool that supports PO
     files
●   Requires back and forth converting to and from
     PO
Litmus
●   Huge collection of manual tests
●   Good for testing problems which cannot be
     tested automatically
●   Requires much time for testing
compare-locales - History

●   Started as a small Perl script for testing localizations
      for missing and obsolete files and entities, only
●   More was needed → rewrite as a bigger Python
     application
        –   checking for other problems, like encoding or DTD
              parsing problems
        –   statistics (e.g.: “unmodified: 500 strings”)
●   Beginning with August 2008: second rewrite, based
     on the Silme library
Other Tools...

●   Verbatim (mozootle)
●   Probably every bigger localization team has
     made an own set of scripts and tools
       –   And every time they start, they start with the
            question:
               ●   “How do we access and parse the L10n-files...”
What are the common problems?

●   focused on the front-end
●   usually dependent on one data format
●   not easy extensible
●   continuous wheel reinvention:
       –   missing layer between apps and data
Silme - Goals

●   generic l10n operations simplified to maximum
●   format independency
●   platform independency
●   easy extensible
●   make localization over time easier
Silme - Target

●   L10n tools developers
●   Localizers with beginner programming
     knowledge
●   Application developers
●   Buildsystem admins
Silme – The Name

●   Silme (seel-may) is a
      letter in the Tengwar
      alphabet (Tolkien)
Silme - Features

●   strong diff support
●   extensible input/output (file, zip, sql, cvs, hg,
     svn, ...)
●   extensible format support (dtd, prop., po,
     l20n, ...)
●   modular (core, diff, formats, io)
●   multilocale
Silme - Structure

●   silme.core
●   silme.diff
●   silme.io
●   silme.format
●   silme.fp
Silme - API - silme.core

●   silme.core.Entity
●   silme.core.EntityList
●   silme.core.L10nObject
●   silme.core.L10nPackage
Silme - API - silme.core.Entity

# properties
offlineApps.manageUsage=Show settings

# dtd
<!ENTITY netError.search.button    quot;Szukajquot;>

# gettext
msgid quot;YaST installation sourcequot;
msgstr quot;Źródło instalacji YaSTquot;
                      id                             value
entity -> offlineApps.manageUsage                 Show settings
            netError.search.button             Źródło instalacji YaST
              YaST installation source                Szukaj
                            id                         value
Silme - API - silme.core.EntityList
      itemHistory.label       Browsing History
   itemHistory.accesskey             B
    itemPasswords.label       Saved Passwords
     itemCookies.label             Cookies


  entityList = EntityList()
  entityList.id = “sanitize.dtd”
  entity = Entity(‘itemHistory.label’)
  entity.setValue(‘Browsing History’)
  entityList.addEntity(entity)
Silme - API - silme.core.L10nObject
                                              entity
                                                       ntemporary
                                               nn     disabledn
<!ENTITY itemCookies.label
quot;Cookiesquot;>                                   comment     entity
<!--                                                   ntemporary
temporary disabled                             n       disabledn
<!ENTITY itemDisabled
“ Dis a b le d ” >                            entity
-->
<!ENTITY itemCookies.accesskey        quot;Cquot;>
<!ENTITY itemCache.label                       n
quot;Cachequot;><!ENTITY itemCache.accesskey quot;aquot;>

                                              entity
                                              entity
Silme - API - EntityList, L10nObject

●   Why both?
      –   EntityLists:
               ●   easy and fast
               ●   no file layout preservation
      –   L10nObject:
               ●   preserves file layout for 1:1 reconstruction
               ●   time consuming
Silme - API - silme.core.L10nPackage

l 10nPackage = {
   id: ‘mozapps’,

   objects: {},

   packages: {

       ‘d o w n l o a d s ’ : . . .

       ‘h e l p ’ : {

           id: ‘help’,

           packages: {},

           objects:{

              ‘h e l p. d t d ’ : L 1 0 n O b j e c t ,

              ‘h e l p. p r o p e r t i e s ’ : L 1 0 n O b j e c t }

       }

       ‘p r o f l e ’ : . . .

   }
Silme - API - silme.diff

●   silme.diff.(Entity|EntityList|L10nObject|
      L10nPackage)Diff
●   silme.core.*.diff()
●   silme.core.*.applyDiff()
    entityDiff = entity.diff(entity2)
    entityListDiff = entityList.diff(entityList2)

    entity2 = entity.applyDiff(entityDiff)
    entityListDiff2 = entityList.applyDiff(entityList2)
Silme - API - silme.io

●   silme.io.manager
●   silme.io.file|svn|cvs|hg|jar|mysql
●   *.getL10nPackage()
●   *.writeL10nPackage()
Silme - API - silme.format

●   silme.format.*.Parser
●   silme.format.*.Structure
●   silme.format.*.Serializer
Silme - API - silme.fp

●   silme.fp.object
●   silme.fp.diff
Silme - Examples

1) Count the number of entities in a directory


2) Find all entities containing the word “karta”
Silme - Future

 TODO:


1)PEP08
2)Documentation
3)Stable release
compare-locales “2.0”

●   Main ideas:
       –   use all the powers of Silme in a tool that would
             provide at least the same functionality like the
             first Python version of compare-locales (for
             the beginning)
       –   use it to ensure that Silme works
compare-locales - log

●   First attempt: make the existing compare-
      locales use Silme as the I/O API
       –   It worked (somehow), but with the use of many
              hacks
●   Final attempt: write it from scratch
compare-locales - Requirements

●   L10n.ini
●   specific output style
●   L10nPackage and L10nObject statistics
●   filtering packages and objects
●   collecting errors and warnings
●   INI-Files
●   adding new features
compare-locales – L10n.ini File
●   Specifies where to look for L10n-files in Mozilla
     source
compare-locales – Output Style
●   Tree-like with short paths
●   As requested by a community
     member:
       –   A second one with full paths
compare-locales – Statistics

●   Provide statistics for entities,
     files and problems
     regarding them
compare-locales – Filtering

●   Filter unneeded elements for testing
compare-locales – Errors

●   There are many things, which should not be in
     a L10n-file. Find and report them:
       –   Encoding problems:



       –   Duplicated entities:
compare-locales – New features

●   Some of the features on previous slides, like
     finding duplicate entities or checking for
     correct encoding, are already new features
●   But there is more. For example:
       –   Checking access keys for correctness
       –   Comparing not only Mozilla source files, but extensions
            too
       –   Spell checking of strings
       –   Your_feature_could_be_here...
compare-locales – Access Keys

●   Basic access keys checks can be done
     automatically:
       –   access key present in the corresponding label
       –   access key with only one character
       –   are this policies being followed:
               https://developer.mozilla.org/en/XUL_Accesskey_FAQ_and_Policies
compare-locales – Extensions
●   Compare extensions, too:




●   Useful for extensions authors to check if missing
     entities will not break the whole application
●   And for AMO: an extension could be checked while
     adding it
compare-locales – New features

●   How complicated is it to add a feature?
       –   Finding duplicate entities:
               ●   3 lines of code
       –   Finding broken access keys (basic version):
               ●   ~ 5 lines
       –   Adding support for comparing extensions:
               ●   Only a few hours of work
Limitations

●   What is not possible with Silme and compare-
     locales:
       –   Testing how the localization works when using
             it with the application it was written for
               ●   MozMill can do automated UI testing
       –   It will not make a coffee for you ;)
Links

●   Silme:
       –   http://diary.braniecki.net/tag/silme/ (Gandalfs blog posts about Silme)
       –   http://hg.mozilla.org/users/zbraniecki_mozilla.com/silme/ (HG repository)

●   Compare-locales:
       –   http://pypi.python.org/simple/compare-locales/ (Python version)
       –   http://hg.mozilla.org/users/akalla_aviary.pl/silme-patched/ (Silme version,
              HG repository)
       –   http://mxr.mozilla.org/seamonkey/source/toolkit/locales/compare-locales.pl
               (Old Perl version)
Q&A
Thank you

More Related Content

What's hot

Memory Management In Python The Basics
Memory Management In Python The BasicsMemory Management In Python The Basics
Memory Management In Python The BasicsNina Zakharenko
 
The Functional Web
The Functional WebThe Functional Web
The Functional WebRyan Riley
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLseleciii44
 
Ancient To Modern: Upgrading nearly a decade of Plone in public radio
Ancient To Modern: Upgrading nearly a decade of Plone in public radioAncient To Modern: Upgrading nearly a decade of Plone in public radio
Ancient To Modern: Upgrading nearly a decade of Plone in public radioCristopher Ewing
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
Get the most out of Solr search with PHP
Get the most out of Solr search with PHPGet the most out of Solr search with PHP
Get the most out of Solr search with PHPPaul Borgermans
 
Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5Michael Girouard
 
Java and SPARQL
Java and SPARQLJava and SPARQL
Java and SPARQLRaji Ghawi
 
Actor based approach in practice for Swift developers
Actor based approach in practice for Swift developersActor based approach in practice for Swift developers
Actor based approach in practice for Swift developersBartosz Polaczyk
 
New techniques in sql obfuscation, from DEFCON 20
New techniques in sql obfuscation, from DEFCON 20New techniques in sql obfuscation, from DEFCON 20
New techniques in sql obfuscation, from DEFCON 20Nick Galbreath
 
#Pharo Days 2016 Data Formats and Protocols
#Pharo Days 2016 Data Formats and Protocols#Pharo Days 2016 Data Formats and Protocols
#Pharo Days 2016 Data Formats and ProtocolsPhilippe Back
 

What's hot (19)

Memory Management In Python The Basics
Memory Management In Python The BasicsMemory Management In Python The Basics
Memory Management In Python The Basics
 
RicoAjaxEngine
RicoAjaxEngineRicoAjaxEngine
RicoAjaxEngine
 
You suck at Memory Analysis
You suck at Memory AnalysisYou suck at Memory Analysis
You suck at Memory Analysis
 
Sailing with Java 8 Streams
Sailing with Java 8 StreamsSailing with Java 8 Streams
Sailing with Java 8 Streams
 
The Functional Web
The Functional WebThe Functional Web
The Functional Web
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTL
 
Ancient To Modern: Upgrading nearly a decade of Plone in public radio
Ancient To Modern: Upgrading nearly a decade of Plone in public radioAncient To Modern: Upgrading nearly a decade of Plone in public radio
Ancient To Modern: Upgrading nearly a decade of Plone in public radio
 
REST API Laravel
REST API LaravelREST API Laravel
REST API Laravel
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Get the most out of Solr search with PHP
Get the most out of Solr search with PHPGet the most out of Solr search with PHP
Get the most out of Solr search with PHP
 
httpie
httpiehttpie
httpie
 
Develop webservice in PHP
Develop webservice in PHPDevelop webservice in PHP
Develop webservice in PHP
 
Core Java - Quiz Questions - Bug Hunt
Core Java - Quiz Questions - Bug HuntCore Java - Quiz Questions - Bug Hunt
Core Java - Quiz Questions - Bug Hunt
 
Java JDBC
Java JDBCJava JDBC
Java JDBC
 
Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5
 
Java and SPARQL
Java and SPARQLJava and SPARQL
Java and SPARQL
 
Actor based approach in practice for Swift developers
Actor based approach in practice for Swift developersActor based approach in practice for Swift developers
Actor based approach in practice for Swift developers
 
New techniques in sql obfuscation, from DEFCON 20
New techniques in sql obfuscation, from DEFCON 20New techniques in sql obfuscation, from DEFCON 20
New techniques in sql obfuscation, from DEFCON 20
 
#Pharo Days 2016 Data Formats and Protocols
#Pharo Days 2016 Data Formats and Protocols#Pharo Days 2016 Data Formats and Protocols
#Pharo Days 2016 Data Formats and Protocols
 

Viewers also liked

What is Localization Testing?
What is Localization Testing?What is Localization Testing?
What is Localization Testing?QA InfoTech
 
Agile testing for large projects
Agile testing for large projectsAgile testing for large projects
Agile testing for large projectsgaoliang641
 
Lessons learned on localization testing
Lessons learned on localization testingLessons learned on localization testing
Lessons learned on localization testinggaoliang641
 
Police Cars Of The World
Police Cars Of The WorldPolice Cars Of The World
Police Cars Of The Worldguestdde0b
 
Fuerza y Coraje
Fuerza y CorajeFuerza y Coraje
Fuerza y Corajeprespower
 
Top 8 games tester resume samples
Top 8 games tester resume samplesTop 8 games tester resume samples
Top 8 games tester resume samplesHaleyBennet345
 
Software Localization (L10N) Quality Assurance from the Tester's Perspective
Software Localization (L10N) Quality Assurance from the Tester's PerspectiveSoftware Localization (L10N) Quality Assurance from the Tester's Perspective
Software Localization (L10N) Quality Assurance from the Tester's PerspectiveCarola F. Berger, PhD, Dipl.-Ing., CT
 
Internationalization & localization testing
Internationalization & localization testingInternationalization & localization testing
Internationalization & localization testingRobin0590
 
Software Internationalization & Localization: Basic Concepts
Software Internationalization & Localization: Basic ConceptsSoftware Internationalization & Localization: Basic Concepts
Software Internationalization & Localization: Basic Conceptsguest1f8175
 
Localization & contextualization
Localization & contextualizationLocalization & contextualization
Localization & contextualizationLdPFerndz Bee
 

Viewers also liked (10)

What is Localization Testing?
What is Localization Testing?What is Localization Testing?
What is Localization Testing?
 
Agile testing for large projects
Agile testing for large projectsAgile testing for large projects
Agile testing for large projects
 
Lessons learned on localization testing
Lessons learned on localization testingLessons learned on localization testing
Lessons learned on localization testing
 
Police Cars Of The World
Police Cars Of The WorldPolice Cars Of The World
Police Cars Of The World
 
Fuerza y Coraje
Fuerza y CorajeFuerza y Coraje
Fuerza y Coraje
 
Top 8 games tester resume samples
Top 8 games tester resume samplesTop 8 games tester resume samples
Top 8 games tester resume samples
 
Software Localization (L10N) Quality Assurance from the Tester's Perspective
Software Localization (L10N) Quality Assurance from the Tester's PerspectiveSoftware Localization (L10N) Quality Assurance from the Tester's Perspective
Software Localization (L10N) Quality Assurance from the Tester's Perspective
 
Internationalization & localization testing
Internationalization & localization testingInternationalization & localization testing
Internationalization & localization testing
 
Software Internationalization & Localization: Basic Concepts
Software Internationalization & Localization: Basic ConceptsSoftware Internationalization & Localization: Basic Concepts
Software Internationalization & Localization: Basic Concepts
 
Localization & contextualization
Localization & contextualizationLocalization & contextualization
Localization & contextualization
 

Similar to Silme & compare-locales

Understanding Framework Architecture using Eclipse
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipseanshunjain
 
George Thiruvathukal, User Experiences with Plone Content Management
George Thiruvathukal, User Experiences with Plone Content Management George Thiruvathukal, User Experiences with Plone Content Management
George Thiruvathukal, User Experiences with Plone Content Management webcontent2007
 
Alfresco monitoring with Nagios and ELK stack
Alfresco monitoring with Nagios and ELK stackAlfresco monitoring with Nagios and ELK stack
Alfresco monitoring with Nagios and ELK stackCesar Capillas
 
Entity Framework V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2ukdpe
 
Use React tools for better Angular apps
Use React tools for better Angular appsUse React tools for better Angular apps
Use React tools for better Angular appsMartin Hochel
 
Black Hat: XML Out-Of-Band Data Retrieval
Black Hat: XML Out-Of-Band Data RetrievalBlack Hat: XML Out-Of-Band Data Retrieval
Black Hat: XML Out-Of-Band Data Retrievalqqlan
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without InterferenceTony Tam
 
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...Jakub "Kuba" Sendor
 
Entity Framework v1 and v2
Entity Framework v1 and v2Entity Framework v1 and v2
Entity Framework v1 and v2Eric Nelson
 
Lares from LOW to PWNED
Lares from LOW to PWNEDLares from LOW to PWNED
Lares from LOW to PWNEDChris Gates
 
WebCamp 2016: DevOps. Ярослав Погребняк: Gobetween - новый лоад балансер для ...
WebCamp 2016: DevOps. Ярослав Погребняк: Gobetween - новый лоад балансер для ...WebCamp 2016: DevOps. Ярослав Погребняк: Gobetween - новый лоад балансер для ...
WebCamp 2016: DevOps. Ярослав Погребняк: Gobetween - новый лоад балансер для ...WebCamp
 
CodeIgniter Ant Scripting
CodeIgniter Ant ScriptingCodeIgniter Ant Scripting
CodeIgniter Ant ScriptingAlbert Rosa
 
Developing Plug-Ins for NetBeans
Developing Plug-Ins for NetBeansDeveloping Plug-Ins for NetBeans
Developing Plug-Ins for NetBeanselliando dias
 
Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTPMykhailo Kolesnyk
 
Running High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclioRunning High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclioiguazio
 

Similar to Silme & compare-locales (20)

Understanding Framework Architecture using Eclipse
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipse
 
Kommons
KommonsKommons
Kommons
 
George Thiruvathukal, User Experiences with Plone Content Management
George Thiruvathukal, User Experiences with Plone Content Management George Thiruvathukal, User Experiences with Plone Content Management
George Thiruvathukal, User Experiences with Plone Content Management
 
Alfresco monitoring with Nagios and ELK stack
Alfresco monitoring with Nagios and ELK stackAlfresco monitoring with Nagios and ELK stack
Alfresco monitoring with Nagios and ELK stack
 
Entity Framework V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2
 
Use React tools for better Angular apps
Use React tools for better Angular appsUse React tools for better Angular apps
Use React tools for better Angular apps
 
Black Hat: XML Out-Of-Band Data Retrieval
Black Hat: XML Out-Of-Band Data RetrievalBlack Hat: XML Out-Of-Band Data Retrieval
Black Hat: XML Out-Of-Band Data Retrieval
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
 
Intro to appcelerator
Intro to appceleratorIntro to appcelerator
Intro to appcelerator
 
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
 
Entity Framework v1 and v2
Entity Framework v1 and v2Entity Framework v1 and v2
Entity Framework v1 and v2
 
End-to-end testing with geb
End-to-end testing with gebEnd-to-end testing with geb
End-to-end testing with geb
 
Python for dummies
Python for dummiesPython for dummies
Python for dummies
 
Lares from LOW to PWNED
Lares from LOW to PWNEDLares from LOW to PWNED
Lares from LOW to PWNED
 
Apache Persistence Layers
Apache Persistence LayersApache Persistence Layers
Apache Persistence Layers
 
WebCamp 2016: DevOps. Ярослав Погребняк: Gobetween - новый лоад балансер для ...
WebCamp 2016: DevOps. Ярослав Погребняк: Gobetween - новый лоад балансер для ...WebCamp 2016: DevOps. Ярослав Погребняк: Gobetween - новый лоад балансер для ...
WebCamp 2016: DevOps. Ярослав Погребняк: Gobetween - новый лоад балансер для ...
 
CodeIgniter Ant Scripting
CodeIgniter Ant ScriptingCodeIgniter Ant Scripting
CodeIgniter Ant Scripting
 
Developing Plug-Ins for NetBeans
Developing Plug-Ins for NetBeansDeveloping Plug-Ins for NetBeans
Developing Plug-Ins for NetBeans
 
Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTP
 
Running High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclioRunning High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclio
 

Recently uploaded

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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
 
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
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
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
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
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
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Silme & compare-locales

  • 1. Localization testing with compare-locales and Silme by Adrian Kalla
  • 2. Me ● Computer Science studies in Wuerzburg/Germany ● Member of the Polish Mozilla-L10n-Community since 2002/2003 ● Internship@MoCo: August-December 2008
  • 3. Why do we need L10n-tests? ● Localizers: – to easily find possible problems ● Developers: – to make sure a localization does not break everything
  • 4. Silme & compare-locales ● Silme is a new localization library written in Python ● Compare-locales is a tool for testing the completeness and correctness of localizations
  • 5. The world before Silme ● Mozilla Translator ● Narro ● Translate Toolkit ● Litmus ● compare-locales ● and much more...
  • 6. Mozilla Translator ● Probably the oldest tool for Mozilla L10n ● Still maintained ● Causes some problems with file layout
  • 7. Narro ● Powerful localization tool ● Translation suggestions ● Language pack creation ● Web-only
  • 8. Translate Toolkit ● Collection of many small tools ● Main goal: convert every L10n file to PO to work with every L10n-Tool that supports PO files ● Requires back and forth converting to and from PO
  • 9. Litmus ● Huge collection of manual tests ● Good for testing problems which cannot be tested automatically ● Requires much time for testing
  • 10. compare-locales - History ● Started as a small Perl script for testing localizations for missing and obsolete files and entities, only ● More was needed → rewrite as a bigger Python application – checking for other problems, like encoding or DTD parsing problems – statistics (e.g.: “unmodified: 500 strings”) ● Beginning with August 2008: second rewrite, based on the Silme library
  • 11. Other Tools... ● Verbatim (mozootle) ● Probably every bigger localization team has made an own set of scripts and tools – And every time they start, they start with the question: ● “How do we access and parse the L10n-files...”
  • 12. What are the common problems? ● focused on the front-end ● usually dependent on one data format ● not easy extensible ● continuous wheel reinvention: – missing layer between apps and data
  • 13. Silme - Goals ● generic l10n operations simplified to maximum ● format independency ● platform independency ● easy extensible ● make localization over time easier
  • 14. Silme - Target ● L10n tools developers ● Localizers with beginner programming knowledge ● Application developers ● Buildsystem admins
  • 15. Silme – The Name ● Silme (seel-may) is a letter in the Tengwar alphabet (Tolkien)
  • 16. Silme - Features ● strong diff support ● extensible input/output (file, zip, sql, cvs, hg, svn, ...) ● extensible format support (dtd, prop., po, l20n, ...) ● modular (core, diff, formats, io) ● multilocale
  • 17. Silme - Structure ● silme.core ● silme.diff ● silme.io ● silme.format ● silme.fp
  • 18. Silme - API - silme.core ● silme.core.Entity ● silme.core.EntityList ● silme.core.L10nObject ● silme.core.L10nPackage
  • 19. Silme - API - silme.core.Entity # properties offlineApps.manageUsage=Show settings # dtd <!ENTITY netError.search.button quot;Szukajquot;> # gettext msgid quot;YaST installation sourcequot; msgstr quot;Źródło instalacji YaSTquot; id value entity -> offlineApps.manageUsage Show settings netError.search.button Źródło instalacji YaST YaST installation source Szukaj id value
  • 20. Silme - API - silme.core.EntityList itemHistory.label Browsing History itemHistory.accesskey B itemPasswords.label Saved Passwords itemCookies.label Cookies entityList = EntityList() entityList.id = “sanitize.dtd” entity = Entity(‘itemHistory.label’) entity.setValue(‘Browsing History’) entityList.addEntity(entity)
  • 21. Silme - API - silme.core.L10nObject entity ntemporary nn disabledn <!ENTITY itemCookies.label quot;Cookiesquot;> comment entity <!-- ntemporary temporary disabled n disabledn <!ENTITY itemDisabled “ Dis a b le d ” > entity --> <!ENTITY itemCookies.accesskey quot;Cquot;> <!ENTITY itemCache.label n quot;Cachequot;><!ENTITY itemCache.accesskey quot;aquot;> entity entity
  • 22. Silme - API - EntityList, L10nObject ● Why both? – EntityLists: ● easy and fast ● no file layout preservation – L10nObject: ● preserves file layout for 1:1 reconstruction ● time consuming
  • 23. Silme - API - silme.core.L10nPackage l 10nPackage = { id: ‘mozapps’, objects: {}, packages: { ‘d o w n l o a d s ’ : . . . ‘h e l p ’ : { id: ‘help’, packages: {}, objects:{ ‘h e l p. d t d ’ : L 1 0 n O b j e c t , ‘h e l p. p r o p e r t i e s ’ : L 1 0 n O b j e c t } } ‘p r o f l e ’ : . . . }
  • 24. Silme - API - silme.diff ● silme.diff.(Entity|EntityList|L10nObject| L10nPackage)Diff ● silme.core.*.diff() ● silme.core.*.applyDiff() entityDiff = entity.diff(entity2) entityListDiff = entityList.diff(entityList2) entity2 = entity.applyDiff(entityDiff) entityListDiff2 = entityList.applyDiff(entityList2)
  • 25. Silme - API - silme.io ● silme.io.manager ● silme.io.file|svn|cvs|hg|jar|mysql ● *.getL10nPackage() ● *.writeL10nPackage()
  • 26. Silme - API - silme.format ● silme.format.*.Parser ● silme.format.*.Structure ● silme.format.*.Serializer
  • 27. Silme - API - silme.fp ● silme.fp.object ● silme.fp.diff
  • 28. Silme - Examples 1) Count the number of entities in a directory 2) Find all entities containing the word “karta”
  • 29. Silme - Future TODO: 1)PEP08 2)Documentation 3)Stable release
  • 30. compare-locales “2.0” ● Main ideas: – use all the powers of Silme in a tool that would provide at least the same functionality like the first Python version of compare-locales (for the beginning) – use it to ensure that Silme works
  • 31. compare-locales - log ● First attempt: make the existing compare- locales use Silme as the I/O API – It worked (somehow), but with the use of many hacks ● Final attempt: write it from scratch
  • 32. compare-locales - Requirements ● L10n.ini ● specific output style ● L10nPackage and L10nObject statistics ● filtering packages and objects ● collecting errors and warnings ● INI-Files ● adding new features
  • 33. compare-locales – L10n.ini File ● Specifies where to look for L10n-files in Mozilla source
  • 34. compare-locales – Output Style ● Tree-like with short paths ● As requested by a community member: – A second one with full paths
  • 35. compare-locales – Statistics ● Provide statistics for entities, files and problems regarding them
  • 36. compare-locales – Filtering ● Filter unneeded elements for testing
  • 37. compare-locales – Errors ● There are many things, which should not be in a L10n-file. Find and report them: – Encoding problems: – Duplicated entities:
  • 38. compare-locales – New features ● Some of the features on previous slides, like finding duplicate entities or checking for correct encoding, are already new features ● But there is more. For example: – Checking access keys for correctness – Comparing not only Mozilla source files, but extensions too – Spell checking of strings – Your_feature_could_be_here...
  • 39. compare-locales – Access Keys ● Basic access keys checks can be done automatically: – access key present in the corresponding label – access key with only one character – are this policies being followed: https://developer.mozilla.org/en/XUL_Accesskey_FAQ_and_Policies
  • 40. compare-locales – Extensions ● Compare extensions, too: ● Useful for extensions authors to check if missing entities will not break the whole application ● And for AMO: an extension could be checked while adding it
  • 41. compare-locales – New features ● How complicated is it to add a feature? – Finding duplicate entities: ● 3 lines of code – Finding broken access keys (basic version): ● ~ 5 lines – Adding support for comparing extensions: ● Only a few hours of work
  • 42. Limitations ● What is not possible with Silme and compare- locales: – Testing how the localization works when using it with the application it was written for ● MozMill can do automated UI testing – It will not make a coffee for you ;)
  • 43. Links ● Silme: – http://diary.braniecki.net/tag/silme/ (Gandalfs blog posts about Silme) – http://hg.mozilla.org/users/zbraniecki_mozilla.com/silme/ (HG repository) ● Compare-locales: – http://pypi.python.org/simple/compare-locales/ (Python version) – http://hg.mozilla.org/users/akalla_aviary.pl/silme-patched/ (Silme version, HG repository) – http://mxr.mozilla.org/seamonkey/source/toolkit/locales/compare-locales.pl (Old Perl version)
  • 44. Q&A