<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I think one of the easiest ways to do it would be to ensure that the actual .swift files are all using the root language of the framework—akin to the development region of an app. Using metadata the IDE would dynamically substitute the localized names, but the underlying file would use the canonical values. Trying to store the localized code in the files makes using version control across language borders impossible.<div class=""><br class=""></div><div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Jeff Kelley</div><div class=""><br class=""></div><div class=""><a href="mailto:SlaunchaMan@gmail.com" class="">SlaunchaMan@gmail.com</a>&nbsp;|&nbsp;<a href="https://twitter.com/SlaunchaMan" class="">@SlaunchaMan</a>&nbsp;|&nbsp;<a href="http://jeffkelley.org" class="">jeffkelley.org</a></div></div></span></div></div></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Mar 24, 2017, at 2:03 PM, Joshua Alvarado &lt;<a href="mailto:alvaradojoshua0@gmail.com" class="">alvaradojoshua0@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I wonder what it would do for reusability. It would be hard to share code between countries written in Spanish or japanense unless the compiler could convert the code to your language. Maybe properties and function calls could be converted over to different&nbsp;languages but I am not sure Swift keywords could be as easily converted which could lead to code with mixed languages due to languages&nbsp;not mapping 1 to 1 on every word. This would be really cool but a LOT of work. I think this is a bigger issue than just adding it into Swift. Taking a look at non-English-based programming languages - <a href="https://en.wikipedia.org/wiki/Non-English-based_programming_languages" class="">https://en.wikipedia.org/wiki/Non-English-based_programming_languages</a> - there are very few, if any, highly used languages on the list. Some languages implemented symbols instead of words so that it is not language based but that would cause breaking changes in Swift :)<div class=""><div class=""><br class=""></div><div class="">It would be cool to see code in different languages:</div><div class=""><br class=""></div><div class="">for i in foo {</div><div class="">&nbsp; &nbsp;print(i)</div><div class="">}<br class=""><div class="gmail_extra"><br class=""></div><div class="gmail_extra">para i en foo {</div><div class="gmail_extra">&nbsp; &nbsp;escribir(i)</div><div class="gmail_extra">}</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Mar 24, 2017 at 11:28 AM, Jeff Kelley via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div style="word-wrap:break-word" class=""><div class="">One of the things that struck me from today’s Apple press release about Swift Playgrounds being localized in more languages is this screenshot:</div><div class=""><br class=""></div><div class=""><span id="cid:4E5A7475-A760-469E-A915-125574AAC56B">&lt;cn_playgrounds_looping.jpeg&gt;</span></div><div class=""><br class=""></div><div class="">All of the UI is fully localized for Chinese, <i class="">except</i>&nbsp;the actual code. As far as I know, almost every major programming language and major platform framework is primarily English; it’s become the <i class="">de facto </i>language for developers. But does that have to be the case?</div><div class=""><br class=""></div><div class="">Imagine a world where alongside our Swift frameworks, we ship <font face="Menlo" class="">.strings</font> 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 “<font face="Menlo" class="">moveForward()</font>”.</div><div class=""><br class=""></div><div class=""><span id="cid:9D276CBF-C25F-4942-A868-F0775B651711">&lt;sp_playgrounds_stepping.jpeg&gt;</span></div><div class=""><br class=""></div><div class="">A scenario where Swift supported localized frameworks might see a <font face="Menlo" class="">.strings</font> file with a format like this:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">"moveForward()": "avanzar()"</font></div><div class=""><br class=""></div><div class="">Then, in Swift code, whether through an IDE, some metadata in a comment in the Swift file, or file extension (think “<font face="Menlo" class=""><a href="http://Foo.es" class="">Foo.es</a>.swift</font>”), a developer who selects Spanish could simply write <font face="Menlo" class="">avanzar()</font> 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!</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><br class=""><div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="font-family: helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="font-family: helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="font-family: helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="font-family: helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><span class="gmail-m_2944716445529640384Apple-style-span" style="border-collapse:separate;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;line-height:normal"><div style="word-wrap:break-word" class=""><div class="">Jeff Kelley</div><div class=""><br class=""></div><div class=""><a href="mailto:SlaunchaMan@gmail.com" class="">SlaunchaMan@gmail.com</a>&nbsp;|&nbsp;<a href="https://twitter.com/SlaunchaMan" class="">@<wbr class="">SlaunchaMan</a>&nbsp;|&nbsp;<a href="http://jeffkelley.org/" class="">jeffkelley.org</a></div></div></span></div></div></div></div></div>
</div>

<br class=""></div></div><br class="">______________________________<wbr class="">_________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-<wbr class="">evolution</a><br class="">
<br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature">Joshua Alvarado<div class=""><a href="mailto:alvaradojoshua0@gmail.com" class="">alvaradojoshua0@gmail.com</a></div></div>
</div></div></div></div>
</div></blockquote></div><br class=""></div></body></html>