[swift-evolution] [Pitch] Localized Swift Frameworks

Jean-Daniel mailing at xenonium.com
Fri Mar 24 15:40:10 CDT 2017


> Le 24 mars 2017 à 18:28, Jeff Kelley via swift-evolution <swift-evolution at swift.org> a écrit :
> 
> One of the things that struck me from today’s Apple press release about Swift Playgrounds being localized in more languages is this screenshot:
> 
> <cn_playgrounds_looping.jpeg>
> 
> All of the UI is fully localized for Chinese, except the actual code. As far as I know, almost every major programming language and major platform framework is primarily English; it’s become the de facto language for developers. But does that have to be the case?
> 
> Imagine a world where alongside our Swift frameworks, we ship .strings files that contain translations of our APIs to other languages. From some other screenshots we see that Swift Playgrounds is providing translations of method names to explain them, here providing “avanzar” for “moveForward()”.
> 
> <sp_playgrounds_stepping.jpeg>
> 
> A scenario where Swift supported localized frameworks might see a .strings file with a format like this:
> 
> "moveForward()": "avanzar()"
> 
> Then, in Swift code, whether through an IDE, some metadata in a comment in the Swift file, or file extension (think “Foo.es.swift”), a developer who selects Spanish could simply write avanzar() and understand it in her native language. In fact, if the IDE is the layer that handles language selection, two developers who don’t even speak the same language could collaborate on code, and names from the framework would appear to each in their native language!
> 
> Comments and locally-defined names are of course still a barrier, but this isn’t new. I know that “mazu” means “first” in Japanese thanks to some code I worked on with an old coworker.
> 
> This is obviously out of scope for Swift 4, and would require significant effort to support, both technically in Swift itself and for those shipping Swift frameworks, both inside and outside of Apple, to provided localized names, so I wanted to throw this out to see if the community is even interested.
> 
> There’s just something about the idea of kids all over the world using Swift Playgrounds completely in their own language that makes me think this could help Swift achieve its stated goal of world dominance.

This has already been done for a couple of languages and it always result in the same very nasty effect: It fragment the community. Trying to search for a method name or a compiler error message in google will returns only the results in your language. 

This is incredibly frustrating, especially when your language is not English. I hate having to work with localized IDE and toolchain for that reason. Extending the localization to the language itself will just make the problem worse.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170324/be39317e/attachment.html>


More information about the swift-evolution mailing list