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

Solving Localization Challenges with Design Pattern Automation

Embed Size (px)

Citation preview

Page 1: Solving Localization Challenges with Design Pattern Automation

Simplify Localization with Design Pattern Automation

an AOP success story by Yan Cui@theburningmonk

Page 2: Solving Localization Challenges with Design Pattern Automation

Hi, my name is Yan Cui@theburningmonk

Page 3: Solving Localization Challenges with Design Pattern Automation

plz ask question in the questions window

Page 4: Solving Localization Challenges with Design Pattern Automation

Watch the webinar recording here:

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

Page 5: Solving Localization Challenges with Design Pattern Automation
Page 6: Solving Localization Challenges with Design Pattern Automation
Page 7: Solving Localization Challenges with Design Pattern Automation
Page 8: Solving Localization Challenges with Design Pattern Automation
Page 9: Solving Localization Challenges with Design Pattern Automation

more text than first 3 Harry Porter books COMBINED!

Page 10: Solving Localization Challenges with Design Pattern Automation
Page 11: Solving Localization Challenges with Design Pattern Automation
Page 12: Solving Localization Challenges with Design Pattern Automation
Page 13: Solving Localization Challenges with Design Pattern Automation

localization needs to be applied in many, many places!

Page 14: Solving Localization Challenges with Design Pattern Automation

http://engt.co/2eQav4x

Page 15: Solving Localization Challenges with Design Pattern Automation

http://engt.co/2eQav4x

Page 16: Solving Localization Challenges with Design Pattern Automation

traditionally…

Page 17: Solving Localization Challenges with Design Pattern Automation

ingest gettext (.po) file

Page 18: Solving Localization Challenges with Design Pattern Automation
Page 19: Solving Localization Challenges with Design Pattern Automation

msgid = original text msgstr = localized text

Page 20: Solving Localization Challenges with Design Pattern Automation

ingest gettext (.po) file

substitute display text

Page 21: Solving Localization Challenges with Design Pattern Automation

Watch the webinar recording here:

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

Page 22: Solving Localization Challenges with Design Pattern Automation

button.text = getLocalizedText("back");

label.text = getLocalizedText("baits");

monster.name = getLocalizedText(monster.name);

...

Page 23: Solving Localization Challenges with Design Pattern Automation

ingest gettext (.po) file

substitute display text

render translated text instead

Page 24: Solving Localization Challenges with Design Pattern Automation
Page 25: Solving Localization Challenges with Design Pattern Automation
Page 26: Solving Localization Challenges with Design Pattern Automation

but wait…

Page 27: Solving Localization Challenges with Design Pattern Automation

but wait…what if we add another type of domain object or add/change

an screen?

Page 28: Solving Localization Challenges with Design Pattern Automation

ingest gettext (.po) file

substitute display text

render translated text instead

Page 29: Solving Localization Challenges with Design Pattern Automation

ingest gettext (.po) file

substitute display text

render translated text instead

Page 30: Solving Localization Challenges with Design Pattern Automation

http://engt.co/2eQav4x

Page 31: Solving Localization Challenges with Design Pattern Automation

hard to get good test coverage scope is too big

Page 32: Solving Localization Challenges with Design Pattern Automation

easy for regressions to creep in during frequent release cycles

Page 33: Solving Localization Challenges with Design Pattern Automation

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

Page 34: Solving Localization Challenges with Design Pattern Automation
Page 35: Solving Localization Challenges with Design Pattern Automation

THINK OUTSIDE

Page 36: Solving Localization Challenges with Design Pattern Automation

publisher service

our pipeline

Page 37: Solving Localization Challenges with Design Pattern Automation

publisher service

our pipeline

+

i’m a CMS

Page 38: Solving Localization Challenges with Design Pattern Automation
Page 39: Solving Localization Challenges with Design Pattern Automation
Page 40: Solving Localization Challenges with Design Pattern Automation

publisher service

our pipeline

validate pre-compute transform schema

Page 41: Solving Localization Challenges with Design Pattern Automation
Page 42: Solving Localization Challenges with Design Pattern Automation

yup, we iterate A LOT!

Page 43: Solving Localization Challenges with Design Pattern Automation

Watch the webinar recording here:

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

Page 44: Solving Localization Challenges with Design Pattern Automation

publisher service

our pipeline

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

Page 45: Solving Localization Challenges with Design Pattern Automation
Page 46: Solving Localization Challenges with Design Pattern Automation

http://bit.ly/2fwvkmS

Page 47: Solving Localization Challenges with Design Pattern Automation

publisher service

our pipeline

chomp, chomp, chomp

chomp, chomp, chomp

chomp, chomp, chomp

Page 48: Solving Localization Challenges with Design Pattern Automation

publisher service

our pipeline

what if we localize here?

Page 49: Solving Localization Challenges with Design Pattern Automation

publisher service

our pipeline

so what goes here is already localized (where

necessary)

Page 50: Solving Localization Challenges with Design Pattern Automation

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/…

Page 51: Solving Localization Challenges with Design Pattern Automation

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/…

don’t localize my stuff!

Page 52: Solving Localization Challenges with Design Pattern Automation

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

Page 53: Solving Localization Challenges with Design Pattern Automation

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

Page 54: Solving Localization Challenges with Design Pattern Automation

ingest gettext (.po) file

substitute display text

render translated text instead

Page 55: Solving Localization Challenges with Design Pattern Automation

server team

Page 56: Solving Localization Challenges with Design Pattern Automation

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

Page 57: Solving Localization Challenges with Design Pattern Automation

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!

Page 58: Solving Localization Challenges with Design Pattern Automation

“thou shall not burn me” - a server dev

Page 59: Solving Localization Challenges with Design Pattern Automation

to ingest .po files in .Net

Page 60: Solving Localization Challenges with Design Pattern Automation

to automate implementation patterns in .Net

Page 61: Solving Localization Challenges with Design Pattern Automation
Page 62: Solving Localization Challenges with Design Pattern Automation
Page 63: Solving Localization Challenges with Design Pattern Automation
Page 64: Solving Localization Challenges with Design Pattern Automation
Page 65: Solving Localization Challenges with Design Pattern Automation
Page 66: Solving Localization Challenges with Design Pattern Automation

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

Page 67: Solving Localization Challenges with Design Pattern Automation

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

Page 68: Solving Localization Challenges with Design Pattern Automation

Watch the webinar recording here:

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

Page 69: Solving Localization Challenges with Design Pattern Automation

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

Page 70: Solving Localization Challenges with Design Pattern Automation

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

Page 71: Solving Localization Challenges with Design Pattern Automation

Q. how do I exclude a DTO from localization?

Page 72: Solving Localization Challenges with Design Pattern Automation

Q. how do I exclude a DTO from localization?

A. use [Localize(AttributeExclude = true)]

Page 73: Solving Localization Challenges with Design Pattern Automation

Q. where did the .po files come from?

Page 74: Solving Localization Challenges with Design Pattern Automation

Q. where did the .po files come from?

A. TNT

publisher service

+.PO

.PO

Page 75: Solving Localization Challenges with Design Pattern Automation

Q. where did the .po files come from?

A. TNT

publisher service

+.PO

.PO

Page 76: Solving Localization Challenges with Design Pattern Automation

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

Page 77: Solving Localization Challenges with Design Pattern Automation

A. you

publisher service

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

game designer

tool for generating new .po file

Page 78: Solving Localization Challenges with Design Pattern Automation
Page 79: Solving Localization Challenges with Design Pattern Automation
Page 80: Solving Localization Challenges with Design Pattern Automation

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

Page 81: Solving Localization Challenges with Design Pattern Automation

A. you

publisher service

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

game designer

tool for uploading .po file

Page 82: Solving Localization Challenges with Design Pattern Automation

Watch the webinar recording here:

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

Page 83: Solving Localization Challenges with Design Pattern Automation
Page 84: Solving Localization Challenges with Design Pattern Automation

@theburningmonktheburningmonk.comgithub.com/theburningmonk