Simplify Localization with
Design Pattern Automation
an AOP success story by Yan Cui
@theburningmonk
Hi, my name is Yan Cui
@theburningmonk
plz ask question in
the questions window
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
traditionally…
ingest gettext (.po) file
msgid = original text
msgstr = localized text
ingest gettext (.po) file
substitute display text
button.text = getLocalizedText("back");
label.text = getLocalizedText("baits");
monster.name = getLocalizedText(monster.na...
ingest gettext (.po) file
substitute display text
render translated text instead
but wait…
but wait…
what 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
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 effort
not future proof
duplicated effort for ea...
THINK
OUTSIDE
publisher
service
our pipeline
publisher
service
our pipeline
+
i’m a CMS
publisher
service
our pipeline
validate
pre-compute
transform schema
yup, we iterate A LOT!
publisher
service
our pipeline
flash/gamespec/298/…
ios/gamespec/298/…
server/gamespec/298/…
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/p...
publisher
service
our pipeline
flash/gamespec/en_GB/298/…
flash/gamespec/pt_BR/298/…
ios/gamespec/en_GB/298/…
ios/gamespec/p...
6 sins of traditional approach to localization
large up-front development effort
not future proof
duplicated effort for ea...
6 sins of traditional approach to localization
large up-front development effort
not future proof
duplicated effort for ea...
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...
1. ingest gettext (.po) file
2. check domain objects for
string fields/properties
3. use localized text when
transforming to...
“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 effort
not future proof
duplicated effort for ea...
6 sins of traditional approach to localization
large up-front development effort
not future proof
duplicated effort for ea...
6 sins of traditional approach to localization
large up-front development effort
not future proof
duplicated effort for ea...
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 file
unchanged s...
A. you
publisher
service
Q. where did TNT get the .po files from?
game designer
tool for uploading .po file
@theburningmonk
theburningmonk.com
github.com/theburningmonk
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Simplify Localization with Design Pattern Automation
Próxima SlideShare
Cargando en…5
×

Simplify Localization with Design Pattern Automation

1.030 visualizaciones

Publicado el

Localization is crucial for reaching out to a global audience, however, it’s often an afterthought for most developers and non-trivial to implement. Traditionally, game developers have outsourced this task due to its time consuming nature.

But it doesn’t have to be this way.

Yan Cui will show you a simple technique his team used at GameSys which allowed them to localize an entire story-driven, episodic MMORPG (with over 5000 items and 1500 quests) in under an hour of work and 50 lines of code, with the help of PostSharp.

Publicado en: Tecnología
0 comentarios
0 recomendaciones
Estadísticas
Notas
  • Sé el primero en comentar

  • Sé el primero en recomendar esto

Sin descargas
Visualizaciones
Visualizaciones totales
1.030
En SlideShare
0
De insertados
0
Número de insertados
664
Acciones
Compartido
0
Descargas
2
Comentarios
0
Recomendaciones
0
Insertados 0
No insertados

No hay notas en la diapositiva.

Simplify Localization with Design Pattern Automation

  1. 1. Simplify Localization with Design Pattern Automation an AOP success story by Yan Cui @theburningmonk
  2. 2. Hi, my name is Yan Cui @theburningmonk
  3. 3. plz ask question in the questions window
  4. 4. more text than first 3 Harry Porter books COMBINED!
  5. 5. localization needs to be applied in many, many places!
  6. 6. http://engt.co/2eQav4x
  7. 7. http://engt.co/2eQav4x
  8. 8. traditionally…
  9. 9. ingest gettext (.po) file
  10. 10. msgid = original text msgstr = localized text
  11. 11. ingest gettext (.po) file substitute display text
  12. 12. button.text = getLocalizedText("back"); label.text = getLocalizedText("baits"); monster.name = getLocalizedText(monster.name); ...
  13. 13. ingest gettext (.po) file substitute display text render translated text instead
  14. 14. but wait…
  15. 15. but wait… what if we add another type of domain object or add/change an screen?
  16. 16. ingest gettext (.po) file substitute display text render translated text instead
  17. 17. ingest gettext (.po) file substitute display text render translated text instead
  18. 18. http://engt.co/2eQav4x
  19. 19. hard to get good test coverage scope is too big
  20. 20. easy for regressions to creep in during frequent release cycles
  21. 21. 6 sins of traditional approach to localization large up-front development effort not future proof duplicated effort for each client platform hard to get good test coverage prone to regressions pressure on QA resources
  22. 22. THINK OUTSIDE
  23. 23. publisher service our pipeline
  24. 24. publisher service our pipeline + i’m a CMS
  25. 25. publisher service our pipeline validate pre-compute transform schema
  26. 26. yup, we iterate A LOT!
  27. 27. publisher service our pipeline flash/gamespec/298/… ios/gamespec/298/… server/gamespec/298/…
  28. 28. http://bit.ly/2fwvkmS
  29. 29. publisher service our pipeline chomp, chomp, chomp chomp, chomp, chomp chomp, chomp, chomp
  30. 30. publisher service our pipeline what if we localize here?
  31. 31. publisher service our pipeline so what goes here is already localized (where necessary)
  32. 32. 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/…
  33. 33. 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!
  34. 34. 6 sins of traditional approach to localization large up-front development effort not future proof duplicated effort for each client platform hard to get good test coverage prone to regressions pressure on QA resources
  35. 35. 6 sins of traditional approach to localization large up-front development effort not future proof duplicated effort for each client platform hard to get good test coverage prone to regressions pressure on QA resources
  36. 36. ingest gettext (.po) file substitute display text render translated text instead
  37. 37. server team
  38. 38. 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
  39. 39. 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!
  40. 40. “thou shall not burn me” - a server dev
  41. 41. to ingest .po files in .Net
  42. 42. to automate implementation patterns in .Net
  43. 43. ps. we had a convention of suffix DTO types with VO
  44. 44. 6 sins of traditional approach to localization large up-front development effort not future proof duplicated effort for each client platform hard to get good test coverage prone to regressions pressure on QA resources
  45. 45. 6 sins of traditional approach to localization large up-front development effort not future proof duplicated effort for each client platform hard to get good test coverage prone to regressions pressure on QA resources
  46. 46. 6 sins of traditional approach to localization large up-front development effort not future proof duplicated effort for each client platform hard to get good test coverage prone to regressions pressure on QA resources
  47. 47. Q. how do I exclude a DTO from localization?
  48. 48. Q. how do I exclude a DTO from localization? A. use [Localize(AttributeExclude = true)]
  49. 49. Q. where did the .po files come from?
  50. 50. Q. where did the .po files come from? A. TNT publisher service +.PO .PO
  51. 51. Q. where did the .po files come from? A. TNT publisher service +.PO .PO
  52. 52. Q. where did TNT get the .po files from?
  53. 53. A. you publisher service Q. where did TNT get the .po files from? game designer tool for generating new .po file
  54. 54. A. you publisher service Q. where did TNT get the .po files from? game designer tool for generating new .po file unchanged strings keep msgstr changed strings has empty msgstr
  55. 55. A. you publisher service Q. where did TNT get the .po files from? game designer tool for uploading .po file
  56. 56. @theburningmonk theburningmonk.com github.com/theburningmonk

×