solving localization challenges with design pattern automation

of 84/84
Simplify Localization with Design Pattern Automation an AOP success story by Yan Cui @theburningmonk

Post on 07-Jan-2017

83 views

Category:

Software

1 download

Embed Size (px)

TRANSCRIPT

  • Simplify Localization with Design Pattern Automation

    an AOP success story by Yan [email protected]

  • Hi, my name is Yan [email protected]

  • plz ask question in the questions window

  • Watch the webinar recording here:

    http://www.postsharp.net/blog/post/ webinar-recording-localization

  • more text than first 3 Harry Porter books COMBINED!

  • localization needs to be applied in many, many places!

  • http://engt.co/2eQav4x

    http://engt.co/2eQav4x

  • http://engt.co/2eQav4x

    http://engt.co/2eQav4x

  • traditionally

  • ingest gettext (.po) file

  • msgid = original text msgstr = localized text

  • ingest gettext (.po) file

    substitute display text

  • Watch the webinar recording here:

    http://www.postsharp.net/blog/post/ webinar-recording-localization

  • button.text = getLocalizedText("back");

    label.text = getLocalizedText("baits");

    monster.name = getLocalizedText(monster.name);

    ...

  • ingest gettext (.po) file

    substitute display text

    render translated text instead

  • but wait

  • but waitwhat if we add another type of domain object or add/change

    an screen?

  • ingest gettext (.po) file

    substitute display text

    render translated text instead

  • ingest gettext (.po) file

    substitute display text

    render translated text instead

  • http://engt.co/2eQav4x

    http://engt.co/2eQav4x

  • hard to get good test coverage scope is too big

  • easy for regressions to creep in during frequent release cycles

  • 6 sins of traditional approach to localization

    large up-front development effortnot future proof

    duplicated effort for each client platformhard to get good test coverage

    prone to regressionspressure on QA resources

  • THINK OUTSIDE

  • publisher service

    our pipeline

  • publisher service

    our pipeline

    +

    im a CMS

  • publisher service

    our pipeline

    validate pre-compute transform schema

  • yup, we iterate A LOT!

  • Watch the webinar recording here:

    http://www.postsharp.net/blog/post/ webinar-recording-localization

  • publisher service

    our pipeline

    flash/gamespec/298/ ios/gamespec/298/ server/gamespec/298/

  • http://bit.ly/2fwvkmS

    http://bit.ly/2fwvkmS

  • publisher service

    our pipeline

    chomp, chomp, chomp

    chomp, chomp, chomp

    chomp, chomp, chomp

  • publisher service

    our pipeline

    what if we localize here?

  • publisher service

    our pipeline

    so what goes here is already localized (where

    necessary)

  • publisher service

    our pipeline

    flash/gamespec/en_GB/298/ flash/gamespec/pt_BR/298/ ios/gamespec/en_GB/298/ ios/gamespec/pt_BR/298/ server/gamespec/298/

  • publisher service

    our pipeline

    flash/gamespec/en_GB/298/ flash/gamespec/pt_BR/298/ ios/gamespec/en_GB/298/ ios/gamespec/pt_BR/298/ server/gamespec/298/

    dont localize my stuff!

  • 6 sins of traditional approach to localization

    large up-front development effortnot future proof

    duplicated effort for each client platformhard to get good test coverage

    prone to regressionspressure on QA resources

  • 6 sins of traditional approach to localization

    large up-front development effortnot future proof

    duplicated effort for each client platformhard to get good test coverage

    prone to regressionspressure on QA resources

  • ingest gettext (.po) file

    substitute display text

    render translated text instead

  • server team

  • 1. ingest gettext (.po) file

    2. check domain objects for string fields/properties

    3. use localized text when transforming to DTO

    4. repeat for next language

  • 1. ingest gettext (.po) file

    2. check domain objects for string fields/properties

    3. use localized text when transforming to DTO

    4. repeat for next language

    hey Watson! I found a Pattern!

  • thou shall not burn me - a server dev

  • to ingest .po files in .Net

  • to automate implementation patterns in .Net

  • ps. we had a convention of suffix DTO types with VO

  • 6 sins of traditional approach to localization

    large up-front development effortnot future proof

    duplicated effort for each client platformhard to get good test coverage

    prone to regressionspressure on QA resources

  • Watch the webinar recording here:

    http://www.postsharp.net/blog/post/ webinar-recording-localization

  • 6 sins of traditional approach to localization

    large up-front development effortnot future proof

    duplicated effort for each client platformhard to get good test coverage

    prone to regressionspressure on QA resources

  • 6 sins of traditional approach to localization

    large up-front development effortnot future proof

    duplicated effort for each client platformhard to get good test coverage

    prone to regressionspressure on QA resources

  • Q. how do I exclude a DTO from localization?

  • Q. how do I exclude a DTO from localization?

    A. use [Localize(AttributeExclude = true)]

  • Q. where did the .po files come from?

  • Q. where did the .po files come from?

    A. TNT

    publisher service

    +.PO.PO

  • Q. where did the .po files come from?

    A. TNT

    publisher service

    +.PO.PO

  • Q. where did TNT get the .po files from?

  • A. you

    publisher service

    Q. where did TNT get the .po files from?

    game designer

    tool for generating new .po file

  • A. you

    publisher service

    Q. where did TNT get the .po files from?

    game designer

    tool for generating new .po fileunchanged strings keep msgstrchanged strings has empty msgstr

  • A. you

    publisher service

    Q. where did TNT get the .po files from?

    game designer

    tool for uploading .po file

  • Watch the webinar recording here:

    http://www.postsharp.net/blog/post/ webinar-recording-localization

  • @theburningmonktheburningmonk.comgithub.com/theburningmonk