internationalizing the virtual world - imug · title: speakeasy template 2006 author: michael g....

17
Copyright © 2008 VMware, Inc. All rights reserved. Internationalizing the Virtual World Ben Gertzfield Senior Member of Technical Staff IMUG, 2008–07–17

Upload: others

Post on 06-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

Internationalizing the Virtual World

Ben GertzfieldSenior Member of Technical StaffIMUG, 2008–07–17

Page 2: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

“I know my i18n, l10n, and g11n…

What’s this v12n thing?

2

Page 3: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

Virtualize World Peace

• Use your applications on any computer anywhere

• Design software for any platform

• Test web apps on any browser

• Finally check out that nasty bug Chinese Windows users keep telling you about

3

Page 4: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

Why Virtualize on Mac?

• Develop and test your software:

• On every operating system

• In every language

• All from the comfort of your Mac

4

Page 5: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

Break down the language barrier

• Distribute software and its OS in a virtual appliance

• No more software that only runs on Japanese Windows

• Run any software on Windows, Mac, and Linux

• No installer or setup needed

• No dependencies on system libraries or device drivers

5

Page 6: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

VMware Fusion: Lots of Firsts

6

• First Mac product developed at VMware

• First consumer product

• First Unicode product

• First release in English, Japanese, French, and German

Page 7: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

Virtualization as the Univeral Translator

7

• Integrate Unicode and legacy OSes

• Copy-and-paste styled, international text

• Shared Folders link Mac and Windows filesystems

• Drag-and-drop filenames with different Unicode normal forms

Page 8: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

Unicodification

• VMware: Unified source code base in C, C++, IA-32 assembly, Objective-C, Objective-C++, Java, C#, Python, Perl…

• Before Fusion: no internationalization framework

• All strings blindly passed as byte arrays (char *)

• Unicode and ICU to the rescue!

8

ยูนิโคด יוניקוד 유니코드 يونيكود Unicode

Page 9: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

One Million Calls to strlwr

• Initial i18n redesign used UTF-16, required ICU everywhere

• ICU’s C++ runtime dependency makes Linux distribution extremely difficult

• Refactored out pure C encoding conversion routines from ICU

• Implemented cross-platform UTF-8 safe string library

9

Page 10: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

The Long Road to Unicode

• Mac OS X is (mostly) Unicode

• No encoding had been ever defined for VMware file formats and protocols

• No cross-platform standard for locale information

10

Page 11: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

Windows: No UTF-8 For You

• Cross-platform code base required compromise

• Linux filesystems and APIs have no defined encoding

• Windows provides UTF-16 versions of most APIs

• Mac OS X string APIs support UTF-8 and UTF-16

• POSIX and Win32 API wrappers to convert UTF-8 to native platform encoding

11

Page 12: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

Lots of Messages in Lots of Bottles

12

• Background processes pass localized and unlocalized messages via RPC

• Extracting messages from Mac, Linux, Win32 binaries

• NIBs and .strings files for Cocoa-only apps

Page 13: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

One Mac, Many Languages

• ADB keycodes undocumented, some values swapped on European keyboards

• No AltGr, no zenkaku, no hankaku

• Key remapping helps, but Mac-like input methods are better

13

Page 14: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

“ Time is an illusion.Virtual time doubly so.

14

(With apologies to Douglas Adams)

Page 15: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

Making Time Work

15

• Easy Install: Hands-free installation of virtual machines (including time zone configuration)

• Windows time zone API uses hard-coded set of time zones

• Mapping POSIX time zones to Windows: GMT offset plus judicious guessing for DST

Page 16: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

The Future of v12n

• VMware Workstation 6.5 first fully internationalized release

• VMware Fusion 2.0 now opens legacy non-UTF-8 VMs created on Windows or Linux

• VMs with non-US ASCII names and data fields portable between Mac, Windows, and Linux for the first time

16

Page 17: Internationalizing the Virtual World - IMUG · Title: Speakeasy Template 2006 Author: Michael G. Hart, Michael Hart Design Created Date: 7/18/2008 4:42:23 AM

Copyright © 2008 VMware, Inc. All rights reserved.

“ Time for Q&A!

17

ご質問などありますか?

Haben Sie Fragen?

请你们提问。