Programming Throwdown - Internationalization
Episode Date: November 28, 2017How can you maintain a separate version of your app/site in all langauges and locales? How do you handle right-to-left text, various currencies, and a bunch of languages with non-ascii charac...ters? We explain all this and more in Internationalization! Show notes: http://www.programmingthrowdown.com/2017/11/episode-72-internationalization.html ★ Support this podcast on Patreon ★
Transcript
Discussion (0)
programming throwdown episode 72 internationalization take it away jason hey everyone so uh this is the last show before our december uh prize giveaway
it's our second annual prize giveaway so last time we gave away i think three t-shirts
um so every time we try and do a little bit more. Thanks everyone for donating, all our patrons.
We put that money to the server costs,
to advertising,
to get the word out,
all of that.
But every year,
we have some left over
and we figure out a way
to give that money back to you
through prizes.
So this year,
we had a little bit more left over
and we also want to do something really cool.
So we're actually going to figure out a way to get a prize to everybody um so it's going to work like
this um uh to all our patreon we're going to give out the three t-shirts yeah yeah to everyone who's
signed up through patreon and supported us um so we'll get uh three people get a t-shirt just like last year. I'm also going to
3D printed some pretty cool things. So three people are going to get this really cool screw
puzzle. If you don't know what that is, it's basically you get these pieces and they all
look kind of goofy. But if you kind of turn them a certain way, then it makes this really cool shape
and it kind of everything kind of locks into place.
So I've printed three of those.
I've also printed three fractal pyramids,
which are pretty cool.
If you haven't seen them, just kind of imagine,
you know, like the Sierpinski triangle, but in 3D.
So three people will get that.
And everyone else who is a patron of ours we're going to figure out a way to mail
you something so we're figuring out now whether it's going to be some type of like 3d printed
badge or a laser cut uh logo or something like that i'm actually going to design it tonight or
tomorrow and i will try out a few designs um ourselves before december
um but uh yeah we're gonna figure out a way to get something to everybody um people who signed
up uh like early patrons might have not put their address so i changed patreon about six months ago
to require an address um but if you signed up early, you might have not given us your address. So please go in
and put in your address or put in something like don't mail me anything. And we know not to not to
pick you as one of the winners. But but yeah, that would help us out a lot. Otherwise, we have to
kind of, you know, email you and track you down and and and wait for you to email us back and all of that so so that's the giveaway pretty excited oh the last thing we're going to uh stream the whole thing
live on twitch um and maybe other things too like i don't know facebook live i don't know if we could
do all of them at the same time maybe i'll figure that out uh we're going to stream it live i'll let
you know more of the details when we have them.
But stay tuned. Follow us on Google+, Facebook, Twitter. I'll post all of them. LinkedIn.
All the regular places I post the show updates. I'll let everyone know when and where we will be streaming live. You feel like a good old Santa Claus now, huh?
That's right. Yeah yeah hopefully you folks get this
in time for christmas it'd be pretty awesome all right put some put some programming throw
down in the stocking now that everyone feels in the holiday spirit we'll do our news wait it's
but it's not it's not our december show so okay anyways um my first link is uh an sqlite sqlite uh three tutorial
and guide uh this was an article i saw recently and as i come across stuff i try to just sort of
squirrel it away um but this one is going over how to use sqlite and although the article is
is quite good um i'm sure there are many other articles as
well in SQLite 3. I wanted to use it as a sort of pseudo tool of the show to be able to talk about
how good SQLite is. And it's actually really commonly used. But if you've never used it before,
check out this tutorial, check out SQLiteite 3 it has lots of really good features and you can find
all sorts of people using it in all kinds of projects i know like a lot of mobile mobile apps
use sqlite for database storage engine people use it you know to sort of serve up on stuff on the
web you know to sort of have a a backend server that uses, if your data
is not so big that you need a kind of fully distributed data store, uh, SQLite three scales
pretty well. Um, and so you can use it for quite a lot of data. Um, but I guess it's the classic,
your data is not really as big as you think it is kind of thing. Like try it until it doesn't work.
And then when it doesn't work you can you know
invest the effort of trying to use something else yeah so for people who don't know sqlite basically
it has the full ansi sql syntax you could do selects you could do joins you do all that stuff
just if you're writing to like a mysql database or something like that but the entire database is
just one file on your computer um so you know it's it's
super cool super portable it works anywhere and actually the entire source code of sqlite is just
one file which is pretty amazing or horrifying i'll go yeah going with amazing actually i think
it's uh it's actually a bunch of files but then they have an amalgamation tool,
which turns it into one file.
Okay, I was going to say,
that sounds like something you just script.
Yeah, yeah.
Cool.
Yeah, SQLite's awesome.
The tutorial, I'm sure it's really useful.
Both of us have used SQLite a ton,
so it's super important.
Definitely take a look at it.
If you're writing massive JSON filesson files that are like you know
half a gig or something you probably need to be using sqlite um depending on circumstance but i
mean i guess that's a good segue i work with a lot of people who have never used sql before
and i actually hadn't until uh my previous job and then i used it and i realized how much i had
been avoiding it like how often it actually comes up and is important to know.
So I did it a little bit in college, but not enough to really understand it.
And then I started using it more and more.
And it's something that if you've avoided it, don't avoid it.
It's actually very important to learn.
It's a good tool to have.
And you can probably get away avoiding it, or at least i did for a while but eventually
you're gonna want to know how to use it yeah i mean i probably well it depends on the time of
year i mean time of the project and stuff but there are times where i spend just all day just
doing sql um because you just it's it's the best for organizing data, transforming data, things like that. It's just, it makes life really, really easy.
Cool.
My news is mask our CNN in TensorFlow.
So I'll explain what that is.
So CNN is convolutional neural network.
I'm not gonna go into too much detail on what that is,
but let's just say it's really good for handling images.
Our CNN is, I think it's like a recurrent.
I actually don't know off the top of my head what the R stands for.
Probably recurrent, but I could be wrong on that.
And then the mask part is basically, think of it as sort of like a set of tiles in the image they're sort of
sliding over and uh super super glossing over all the details but check out this link um basically
it's for image object detection and recognition images so you can give it an image with a bunch
of different objects there's like a person walking on the street and a traffic light in a car
and it will say hey there's a person and a traffic light and a car, and it will say, hey, there's a person and a traffic light and a car, and here's where they
are, and here's their bounding box, and this is their label. So, you know, you can imagine,
like, regular image processing, where, you know, you give it a bunch of digits, right,
zero through nine digits, and then you give it another digit and it says oh that's a seven
right but what if you gave it you know a book full of digits like a book full of numbers that's a
much much different problem because you have to turn that page to turn that that image of that
book you know pull out all of the individual numbers, like know they're there, pull them out, and then run that first step,
which says whether it's a seven or an eight, right?
So it's pretty complicated stuff.
The cool thing about this is that it's totally open source
and it actually comes with the data.
So it's not like one of these things where, you know,
you're just never gonna be able to run it.
Like if you just follow the instructions, you actually download the data, build the model, and you'll be able to detect like cars and traffic lights and stuff like that.
Sheep, donuts.
Pretty cool.
Sheep and donuts?
That's a thing.
I don't know.
It's at the bottom of the examples.
Oh, okay.
Nice.
But yeah, and it goes into tremendous detail it's it's really
really cool and uh if nothing else you can just run the lines they tell you to and you'll get
this really cool thing at the end so so uh check it out yeah this seems like a like even more so
than you were saying like uh character, sort of recognizing occluded objects, generating the mask for them.
So not just saying, is there a person in this image, but where are they and exactly what shape are they?
Yep.
That seems really tough.
Yeah, it's pretty amazing.
As Patrick said, it handles occlusion.
So you could have a person and you could have
a stop sign in front of the person and it'll actually handle that.
Like basically it will remove the stop sign or it'll just kind of like...
Yeah, I don't actually know...
I'm not an image processing guy, so I don't know a lot about how it actually works under
the hood. But it can actually say, oh, these pixels probably don't belong to this person.
And so it says, I don't know what these pixels really are, but I know these pixels around are like this.
And then it can say, oh, that's a person.
Because even though there's all these non-person pixels there, I know that it's sort of a segment, a different segment.
So it does a lot of complicated stuff.
And like a lot of things,
neural networks have sort of automated
a lot of the human engineering,
which is pretty remarkable.
And that trend continues.
But yeah, check this out.
I thought it was pretty amazing to look at.
That's pretty cool.
My next article asks the question, do you have learner's syndrome?
They admit right off the bat that learner's syndrome is not really a thing.
And they proceed to point out something that I've thought about a fair amount, especially, you know, now that I've been working as a software engineer for too long.
And, you know, you see people come in and they're all excited and gung ho and they feel like they have the solution to everything.
Right. Or what if we only just use this technology or use that technology and most we've talked about you know various languages before that that are you know three
decades old or more uh oh four decades wow i can't believe it's 2017 um anyways it's
and so we use like c++ and although we use you C++ 11, almost 14, even that is buggy.
But C++ goes back many, many years, has a lot of inertia behind it, a lot of historic stuff.
And people are like, oh, if we could just use insert whatever up and coming language now, then all our problems would be solved.
Sure, Rust.
And what I find myself realizing is
that I think one of the desires in technology,
or at least for me,
and I think for my coworkers,
is to always be learning something new
just for the sake of having an excuse to learn it.
Like we have pretty flexible jobs for the most part
where we have a lot of autonomy relative to, you know,
if you were working on a factory assembly line or something.
You have a lot of latitude to make decisions on things.
And so people look for excuses to use things
that they would just like to learn.
And this article points out under the context of of sort of web development
all the different frameworks that come out and how you have to know this and know that you're
expected to know you know all of the full stack front end back end databases you're you know you're
kind of expecting everything but then people even just have all this desire to learn new frameworks
but the most they ever do is probably you know know, code up an example. They never really do much with it. And so they, they feel like they're accomplishing all of this
learning. Um, but it's really doesn't help them. It doesn't benefit anything. They're not saying
what problem do I have and could I find something better to solve it with? Uh, and so it's not a
terribly long article, but it just begs the question that I think I notice a lot,
which is,
although it's great to learn.
And I mean,
we have a podcast where we talk about some technology or programming
language every month.
I think that it is important to,
to realize that it's not always great to jump on the newest thing.
And that as you're using new things,
as opposed to just being like,
Oh,
this is the best thing ever.
Let's use it everywhere.
You know, I always always I use this expression.
It's not mine.
I don't know where it came from, though.
But, you know, it's another tool in the tool belt.
Right.
If all you have is a hammer, everything's a nail.
So don't only have a hammer.
You know, get yourself a set of tools and then make sure you use the right tool for the right job.
Going around and just saying like oh
rust is cool i mean rust is cool but like going around saying rust is cool let's solve all the
problems in rust yeah that's not gonna end up any better than when we try to solve all the problems
in c++ or try to solve all the problems in java right um although any of those might work they're
probably not the best answer yeah i mean i i actually
experienced this firsthand when i was brand new like first job um out of undergrad i only really
knew c++ and uh and a little bit of java and uh basically i i wanted to build this is a sort of side project of mine, which I wanted to build this kind of really kind of open ended environment where I had these agents that had different AI and stuff like that.
And, you know, because it was AI and I was having a lot of different variables, I need something that's really dynamic.
And so I basically had this class in C++.
C++ class, it just had a map from variant to variant.
And then I had this variant class that used the boost variant library.
So it could be an integer or a string or it could be anything, right?
Oh, dear.
And so I had this class that was basically just a map of anything to anything.
And then everything just started being a map of anything to anything.
And I ended up with this sort of dynamic language.
I could even script things like that.
And at some point I realized, like not soon after, that I had built like just the worst version of Python ever.
You know, like it was just, I mean, it was that Python was exactly that,
but then a million other things too and way optimized and stuff like that.
And I think the big thing about this show is we explain all these different languages to people
so that they can sort of understand the
context like they can embed the languages that they know in sort of this greater context and
so they won't try and build like a very poor man's python in c++ um but yeah with that said i kind of
i have uh sort of the opposite problem where I don't really like learning a bunch of different languages to do.
Like, I don't like learning some crazy language.
I would rather sort of like deconstruct something into a language that already exists.
Like, I've worked at jobs where people had sort of custom languages.
And it almost always seemed like that language could have been replaced with Python.
But I do have times where I have sort of this,
maybe it's like an analysis paralysis
where I want to do a project
and there's maybe four or five different frameworks.
And I end up bouncing between learning these frameworks
instead of actually doing the project. And if i just picked even the worst of the five i would have got way
more done yeah so on the exact topic of the article i think it's saying that is you know
maybe a little less learning and a little more using the thing you know to get stuff done uh
but yeah i mean i think you're absolutely right which is
whenever i start a project and i can choose what to do or how to approach it the going is really
slow i find it very difficult to discipline myself to sort of i'm just going to pick something and
solve it poorly and then figure out how to do it again um yeah i tend to bounce back and forth oh like
he's working on some project that is like wrote a little bit of java then wrote a little bit of
python then it's like oh maybe i should do it in c++ i was just like oh this is terrible
like i'm just gonna pick one get it done and then i'll choose yeah that's a good point i actually
i'm working on a a little game to teach machine learning to uh kids i've
been working on this for for years but i i i shelved it for a long time and now i got back
into it and uh there's this engine that everybody uses now it just exploded in popularity it's
called godot uh like the mathematician and uh it has their own language called Godot script and I just
hated having to learn another language so I kind of you know put it off I was
looking at other frameworks and things like that and then finally I just said
forget it let me just learn this Godot script and and you know get this done
because because this I mean if you could learn this language the tooling on this
thing's amazing
and basically it was a bit of a pain for a few days but i think part of you know recording this
show for however many years we've been doing it i was able to pick up the language pretty quick
in like an hour or so and then uh yeah i actually have a quick like a simple demo like like a level
one of the game um um and it exports to android and everything else
but it's like if i didn't get over that barrier i just wouldn't have had really anything
so it's definitely it's a tricky balance but uh yeah learner syndrome is kind of going too far
on the other end so with that in mind my tool this show is unity 3d ml agents so yeah so you know the only engine
that really rivals godot is unity um unity's closed source so uh i'm gonna stick with godot
for now but it's pretty amazing i mean at most a lot of professional game studios use unity
um it's got a bunch of amazing features i think we actually
did we do a show on unity yeah we did okay so so uh check out that show we talk about it in great
detail um they added this thing yeah ml agents basically um they add a variety of different
reinforcement learning um agents and uh it's pretty cool so so you can you can give
them sort of a a you know a representation of the world or you could
even just have a camera and it will learn from the camera you know as best
they can and yeah they have a bunch of cool demos they have this this multi-age, so they have different sort of categories,
which I found kind of interesting.
They have sort of a single agent.
So this is, you know, imagine you're writing AI
to play Frogger, like to be the frog in Frogger.
So in this case, you know, you have this environment
with all these cars that move around and stuff like that.
And the agent has to sort of, you know, navigate this environment with all these cars that move around and stuff like that and the agent has to sort of you know navigate that maze right but then it gets much more
interesting with multiple agents so you can have for example 10 agents that are all sort of
cooperating they have like one mind that's controlling all 10 of them and so they can
kind of coordinate you have this one where they're all sort of them and so they can kind of coordinate um you have this one
where they're all sort of 10 agents but they're all against each other and so they don't share
information and stuff like that and it kind of breaks it down it has some cool demos and uh i i
noticed they left out the case where there's more than three agents or more than two agents that can cooperate um and the reason
why they left it out is that's an open research problem so it says actually says demo coming soon
for that one and i'm wondering like it's it's sort of like saying you know it's a joke yeah
yeah it's sort of like saying space travel you know faster than light travel coming soon yeah
yeah like as a reinforcement learning researcher, I'm just like, really?
How soon is that?
But I mean, they could obviously build something, but something that would work in that general
problem is currently like an open research problem.
But it's pretty cool.
Definitely check it out.
The demos look pretty neat.
So. definitely check it out and the demos look pretty neat so that's so i think it's now time for book of the book of the show i'm totally cheating here but
i have to admit i've done a ton of reading in this game and uh and uh took my whole month
or at least since the last show we recorded it's called 80 days it's
based on the Jules Verne book which I have not read because I've been too busy playing this game
but it I think it's pretty faithful to the book from reading the reviews and things like that
basically in 80 days you there's a very small sort of shell of a game where you have to go to different cities and you can pick which city to go to and you can take a few actions when you're in the city.
But that's basically a thin shell around what is really like a very detailed, you know, interactive fiction.
So there's a bunch of sort of think of
an interactive fiction as like a choose your own adventure um but just a little bit more open-ended
right um and yeah you can depending on what trajectory you take to go around the world and
there's many um you get just all these really interesting stories and you know i won't spoil
any of it because it's it's like a book you know if you if i was to say one of the stories it would just ruin it
so i won't spoil anything but uh um it's really cool i highly recommend it they have it on android
ios they probably have it on pc as well um and uh yeah check it out and it's actually it makes
me really want to read the actual book so i i had always
thought that 80 days was a i knew it was a fiction book but i thought it was a fiction book based on
the real world you know like like i figured they'd be taking boats and trains and stuff like that
what i did not expect was there's a bunch of like fantastical creatures and things like that um and uh uh you know a bunch
of like fantastical machines and everything it's it's really cool and and it's very well done
very nice my book of the show is a traditional book
uh although i did listen to it instead of read it is forging forging hefestus um so this
book i think is relatively new and i didn't find it to be an especially uh deep or in engaging book
but it was a nice sort of whatever you call like uh pop pop breed like pop music popular whatever
i don't know um and it is a science fiction book i guess it's about a a woman who
has superpowers oh this is gonna sound so cheesy anyways it's about a woman who has superpowers
also likes building things and she gets herself wrapped up into a world where lots of other people
have superpowers and she basically is in finds herself in league with a group of villains and sort of talking through how the villains interact and, you know, how the world works with all the superheroes.
And it doesn't go in depth to, you know, trying to come up with plausible science as to how all this works.
In fact, it sort of pokes fun at that.
But it's just a sort of a nice
fun light read um and this was by a person named drew hayes i've i've never read anything of theirs
before but i thought this was a nice easy read definitely didn't you know wasn't a brain burner
or like whoa i gotta rewind that hang on what just happened uh just a nice easy light fun read about
sort of you know what i imagine you know, what I imagine, you know, well, they actually
do write books about comic books, like books involving the people from comic books. It's kind
of like that. Like if you just have a nice, like what you would read in a comic book, but someone
actually wrote it with words instead of, uh, comic book pages. Cool. I'm doing a terrible job.
It's so hard to describe a book no it sounds good i mean it
sounds like uh is it like a kind of a parody of of comic books or no it's just in that vein
so i've previously brandon sanderson has uh a book about superheroes as well um what was it called
oh man i think it's like calamity and there's i think i've recommended a
couple of the books in that series uh anyways and this is sort of in a similar vein except
a little more goofy and light-hearted i guess um but no it's not a parody of it it's just sort of
you know most you can't write a comic book about batman you know because batman is licensed so everyone
has to come up with their own kind of stuff and they're not you know making fun of batman they
didn't have their own characters and doing their own thing but i you can't sort of write in that
without paying some sort of homage to those kinds of things so i wouldn't say it's a parody but it
is just trying to be sort of in the same style. Okay, that makes sense.
Very cool.
I feel like I should just read the, whatever, the back of the book
because I think they would do a better job.
That's boring.
You can just go online and do that.
Yeah, yeah.
I mean, the goal is to get people inspired enough to do that.
So, yes, if you're looking for a lighthearted book set
in a comic book style setting
without any trademark infringing characters
i would recommend forging hefestus uh it's the villain's code book one although as far as i know
there's no book two yet so tbd if it actually becomes a series very cool yeah i'm reading uh
the book of the show from last month uh the claude shannon book when
i'm done with that i'm actually and i'm actually um i chose to read that book like like read read
it um so i have a really long flight coming up so i think i will i will get this and i'll listen to
it nice cool and i'll listen to it on audible so I have uh I have an audible subscription and it's been
uh the audience knows probably better than we do or someone in the audience knows when I said I
got the subscription I think it's been about six months but I've definitely used every credit
almost immediately and it's been it's been a lot of fun if you want to get an audible subscription
and help us out at the same time,
you can go to audibletrial.com
programmingthrowdown. We have a link
in the show notes. And when you
sign up, you'll get a free book
and you'll also help out the show.
Very nice. And Jason already
mentioned our Patreon, but if you
go to patreon.com
programmingthrowdown, you can
elect to give us a donation for each
episode that we release and we're thankful to all the people who have done audible trials uh and who
sponsor us on patreon uh definitely helps encourage us uh to keep making shows yeah definitely i mean
you can uh i won't i won't feel bad if uh i won't make you feel bad if you join Patreon
win the biggest prize
and then leave
you're totally free to do that
but we appreciate everybody
even if you just joined for a month
we appreciate that you
helped us out, it really keeps the show going
it lets us reach new people
and all that good stuff
my tool of the show is firefox
developer edition so uh one thing about this so firefox alpha which hopefully becomes beta or
becomes firefox very soon is amazing um and and actually i uh haven't used firefox hadn't used
firefox in years.
Somebody at work just said, hey, you have to check out the new Firefox.
It was somebody who works on our WebSpeed team.
And so I took his opinion really seriously.
And so I checked it out.
And it is amazing.
Like, I can't wait for this to come out. It doesn't use very much RAM.
It runs super fast.
And I feel like Chrome was really amazing when Chrome came out.
But now it's kind of, especially in terms of how much memory it uses,
it's becoming kind of more and more bloated.
And Firefox, they basically redid everything.
They started kind of from the ground up.
And I think a lot of it is in rust that they rewrote it in rust i don't know if that matters or not in terms of like what i'm seeing
but i'm just the performance is unbelievable um and so firefox developer edition is a fork of
firefox alpha which has a bunch of really cool features for developers.
Like it'll do really intense profiling of your website.
It has a bunch of really cool features like JavaScript debugging and things like that.
And it's running Firefox Alpha.
And even though it has all these developer features, you could use it as your regular browser if you wanted to.
So definitely download this. Check it out. You'll be blown away at how amazing it is um and and you could also
see some really cool debugging while you're there i saw someone else mentioned that the new firefox
was pretty good but i haven't i don't know i'm too lazy now i guess i should check it out
but will it migrate all of my like bookmarks and tabs because i have
lots of tabs yeah so um you know i actually had back when i ran firefox and chrome kind of
alternating um there's a thing called a bookmark box it's an extension and it basically syncs your
bookmarks to dropbox and if you run the same extension on on multiple
browsers it'll just keep everything in sync oh i should have done i should make that the tool of
the show and install it right now um there you go you could do that yeah i don't know i i guess my
thing is i use tons of tabs like i use tabs as sort of a light for an ephemeral bookmark or
whatever um which makes me sad if my browser ever crashes and I lose my,
but,
um,
I just sort of,
I don't like the creating a bookmark seems so permanent.
Um,
yeah,
it's true.
There really needs to be a better,
and I like just sort of scrolling through hacker news or Reddit or whatever,
and just like,
you know,
doing command click or middle click on the mouse and just like click,
click,
click,
click,
click, click click click
like opening a ton of things and leaving them as sort of like a very you know i'll skim them later
and then close i don't want to bookmark it but man i get so much flack at work when people ever
come by and they're like dude how many tabs do you have you know it's funny i get i have exactly
the same thing and everyone says the same thing to me too it's like great minds think alike
i'm gonna go with that i'm gonna say next time someone tells me that the great jason
said that he also runs a ton of tabs and i'll do the same thing and no one will know that no one
will know who the other one is oh there we go uh we just need like famous twitter accounts now or
something be like yeah that's right.
Patrick says.
We need to get the blue badge or whatever.
The verified badge.
I've been on Twitter and I don't even know how long.
I hear it's popular these days.
I feel like I have to give a financial statement.
I'm short Twitter.
If it goes down, that makes me money.
Wait, are you kidding or are you serious no i'm
serious but that's okay really yeah i've actually i've never shorted anything my whole life i mean
i know what it is but i just i just feel like it's for it's for the pros oh wow i i feel
scared or i don't know i'm not you know i'm not a good person to ask investment advice
okay well this will be it'll derail the conversation greatly but yes i yeah yeah
so we'll move on interesting okay i'm not long twitter so no no spilt milk if uh they go down
um there you go my tool of the show is a game surprise uh the witness and yes i know i'm
really late to the party everyone already played this a long time ago on their computer um but i've
been playing it on my ipad and uh although i did start playing it without a controller like i do
have a wireless controller and i initially i was trying to play this and i saw some of the reviews
saying oh you really got to use a controller i was like oh this is no problem um i'm just enjoying just tapping
this is working well and then i got to a couple puzzles and i was like oh you totally have to have
a controller um oh and so do well if you've have you if you've played the witness you'll you'll
know but if you've not it's a puzzle game by this i think it's the same
guy who made um braid jonathan blow is it yeah that's right and so it's uh in the vein of kind
of like i guess mr raven if you've ever played played one of those where um there's all of these
puzzles to do but sometimes the puzzles are you know very obvious like there's
a blinking thing on the screen and you need to you know interact with it in some way and sometimes
you need to sort of position yourself very carefully within the environment like look in a
very specific direction uh from a very specific spot so that you can see a clue um so if you
imagine like whatever they show when
they you know do stonehenge like on a certain night if you look to a certain hole drilled in
a certain stone then you can see the you know for one minute the moon appears in the hole or whatever
you know something like that like you need to be lined up at this specific spot and if
the fine-tune adjustments sort of necessitate needing a for me uh the video game
controller the sort of wireless controller to be able to kind of move your position very slightly
but other than that the game itself i'm really enjoying i'm terrible at it i think like i feel
it's one of those things that makes you feel like you're missing out a bunch of things
but i've been trying to not cheat and use the strategy guide okay it's not cheating but i just feel is one of those things that makes you feel like you're missing out a bunch of things but
i've been trying to not cheat and use the strategy guide okay it's not cheating but i just try not to
use the strategy guide because i know i could just look up all the answers to all the puzzles but if
i'm going to do that i should just you know like watch a walkthrough on youtube or something yeah
i don't ruin the game yeah exactly um but it's really tough to you know sort of play through and
some of the things,
I have had to look at the strategy guide a couple of times because some stuff I felt like,
oh, that wasn't completely obvious.
And I am a not long attention span gamer.
So I knew I would just give up before figuring it out.
But overall, I've really enjoyed the puzzles.
They're very varied.
And I mean, I think they're pretty well thought out.
So if you've not checked out The witness before a puzzle gamer puzzle game uh now it's available on
i think pc android ios you know everything so and it is a little bit of a premium game i think it
i think when i bought it was like 15 or 20 dollars um but i mean it's a really good game and you
would pay way more than that you know for it on
the pc when it first came out so i don't feel that bad yeah it makes sense i'm surprised actually
that there aren't 50 games on ios yeah i mean yeah it seems like i mean i'm surprised i still feel
that 50 60 70 games are really expensive i in fact okay maybe that's true
maybe i don't think i've ever oh yeah i just like yeah i guess i'm surprised pc games aren't 30
dollars i'm surprised ios games aren't 30 yes i agree more with this sentiment yeah i'm not the
kind of person maybe i think i've played games when they first came out but i don't play a lot
online so i don't feel compelled to buy a game when it first comes out so i always buy them when they're
yeah like five dollars yeah so yeah like five years later
hey nothing wrong with that a lot of games are i still play a lot of classics oh which i will say
if you're into that kind of thing i joined a subreddit. I think it's called patient gamers,
which is for other people of like-minded thing about playing,
playing games long after they've come out.
And it's all,
it's kind of fun.
Cause it's all about people being like,
I know that I've,
I finally got around to playing this game.
Like here's a top post.
Currently finally finished the first assassin's creed,
which even knows how long that came out.
Playing Zelda A Link to the Past for the first time.
Oh, man, that game's great.
Yeah, so people are just sort of talking about,
instead of, oh, the latest, greatest game,
the latest, greatest patch,
they're talking about things that came out a long time ago.
And there's a lot of good stuff in here
I sort of forgot about or didn't know about
that's really cheap and sales.
And also, my computer is not sort of up to scratch
to playing modern games.
So there's that.
Now, it doesn't have things like,
it isn't mostly about console games.
There are occasionally,
but it's not like you would see on kind of an emulator
or forum where people are talking about talking about you know classic super nintendo games all the time it's
a lot about pc games but you will occasionally see um console games on there as well
no very cool no i guess it's a mix maybe an even mix uh that was off topic sorry
no no it's fine yeah i'll have to check that out i love going back and playing old games all right time for internationalization internationalist i18n as they
say i did not know what that meant for a very long time i will not lie me too i had no idea
so for people who don't know i18n it's it's just because there's 18 letters in between the first and last letter of
internationalization. So it's just the I of internationalization, then 18, then the N.
And they have the same for localization. It's L-10-N. And yeah, for the longest time, I was
like, what is, I mean, I knew vaguely what it was about, but I had no idea the context of that.
I feel like you and I probably learned this at the same place yeah yeah exactly so yeah i i too i i somehow
by context figured out what it was um but yeah someone had to explain it to me oh really oh no
i never yeah anyways i actually just thought it was like because if if you say I-18N, it kind of sounds like it.
So I never bothered to count the letters.
Oh, no.
In my case, basically, like I just went to this meeting and right off the bat, the person was like, how many people here have heard of I-18N?
And they just explained it.
Oh, OK.
OK.
Yeah, I didn't didn't have that.
So so different.
Let's talk about what localization and internationalization are
and what the difference is.
So I think when, for me at least,
I mostly hear the term internationalization, I18N,
but often people mean localization.
So we'll talk about localization first
because I think it's the one that, you know,
you probably think about when you hear it, which localization is sort of translating a computer app or program or website to a different location.
So you're making it local to a person's language, to their customs for things um you're doing all of the stuff to make it feel as if sort of that
piece of software was written for only for people in that area so each person gets a different locale
you know if when you install windows and it asks you you know sort of where you are and what
language you speak the idea is they want to make it feel like Windows was written supporting where you are in the world as if local people wrote it.
Internationalization is making software that can be localized.
So not making assumptions in the code about which stuff we're going to talk about.
But sort of the act of supporting localization
is kind of called internationalization.
But internationalization could also kind of mean
doing things in a way such that, you know,
the most people feel that it's kind of the right way,
even if you don't do localization.
So you can do internationalization without localization. And I guess in theory, you could do localization even if you didn can do internationalization without localization and i guess in theory you
could do localization even if you didn't do internationalization but it would make it really
miserable um yeah how would that work so i mean you could just for instance like take all of the
byte code for a program and change the strings from english to Spanish and hope that, you know, they're all the same length or something.
Right.
You could do it.
Yeah.
I don't know that people do do that.
It would just,
yeah,
it would be horrible.
Right.
You know,
or,
or you kind of think of like you,
the equivalent of running Google translate,
you know,
instead of having someone translate your page for you,
uh,
or, or doing it yourself, you could sort of just scrape all the text off of a page and run it through Google Translate and then claim that was your localization strategy without having done much internationalization.
Makes sense.
Okay.
Anyways.
So why don't you tell us some about the the kinds of things you should worry about yeah so so localization and internationalization is actually really really hard i mean it sounds
easy but um but there's a lot of complexity and it makes sense i mean the world it's a big place
yeah there's just there's just i try to figure out i feel like if you say this wrong it comes
off really bad so i'm like i want to be really careful but basically like there's just several
there's many civilizations that have been around for a really long time and so there's a completely
different set of customs and all of that is sort of reflected in the language right um so for
example there are some uh there's some uh languages that go
right to left like i think hebrew goes right to left and uh i don't know it's the only one i can
think of but uh and there are some that go bottom to top like i think japanese right or chinese or
something or maybe it's just in their sign but there are definitely some languages where when written they they start at the bottom and go up um so that's that's something to think about like you
so if you have something left justified in in english it probably should be right justified
in hebrew right um there's sometimes uh there's some uh places in the world where they use the period to separate numbers so if you have like a thousand
it'll be 1.000 right i think most european countries are like this in the u.s and canada
these commas right currency symbols right i mean so easy you put a dollar sign you know for a
hundred dollars but it's a pound and it's who knows how many is probably tens of
of different currency symbols at least um also the dates um we do month day year um actually
there's like a bunch of places in the world where they do day month year which actually kind of
makes more sense like as from a computer science standpoint but uh, you know, those are two sort of different standards.
And even though like day, month, year might make sense,
you know, logically, you know,
everyone in the US is used to seeing month, day, year.
And so we have to be able to accommodate
sort of both of those standards, right?
So there's a lot more going on than just replacing strings.
I think other things that, you know, sort of thinking about this, and a lot of it applies, I guess, maybe more so to kind of websites than to software per se.
But you got to realize there's cultural differences as well. putting a bacon cheeseburger on the front of your, you know, non food related site, um, may appeal to
you as a, you know, American, but somebody who is sort of doesn't eat pork, then they're going to
see that bacon or someone who doesn't eat beef is going to see the hamburger, you know, they're
going to be, they're not going to have the reaction you wanted them to have, um, or that you thought
they might have by looking at that thing or someone who's
vegan, right?
Like everyone's going to have a different reaction based not just on where you live,
but, you know, lots of different things about who you are.
And so thinking about those kinds of things, I think, can also come into play here, which
is understanding who your audience is.
Yeah, yeah, absolutely. Yeah. That's a really good point. I
mean, it's, even if you do all of this, right, it's not necessarily the end. Like you also have
to think about just the entire experience and the whole, the whole app user experience, you know,
is it catering to the different markets that you're operating in?
The one that I always think about, I guess, is,
and I've not spent a ton of time doing it, but I know it's a thing, is I always came from C where a character is a byte, a char.
And a character is eight bits of which only 127 are actually valid um and so it's the lower 127
numbers and you can look up you know whatever that guy who's probably made millions of dollars
when you search ascii table uh and it comes up yeah that's right and i i forget i think i saw
it one time this guy anyways this person runs this website asciitable.com and every time you search asciitable if you're a c programmer you've you've
looked this up before i know you have um and so this is what i always think about when i think
about character sets but this is by no means not even the beginning of all of the characters that's right yeah i mean there's um so unicorn unicode is uh
is incredibly complex i only know just the very basics um but basically
unicode is is at this point it's like pretty well standardized um and it can represent just so many different
characters um there's unbelievable like all sorts like acrylic and arabic and chinese and different
like traditional and simplified and it just like goes on and on and on um but the really kind of
cool uh there's different you know utf un Unicode text formats. But the most interesting widely
used one is UTF-8. And the cool thing about UTF-8 is, you know, if you're just doing characters 0
to 128, so, you know, this includes all the, you know, English letters digits and and symbols and you know most of the things that you're
used to printing on the console um those are actually they translate there's there's they're
the same character so in other words if you want to print like a lowercase p then whatever the
ascii value for that is the utf-8 value is the same thing. And so every ASCII file you have is also a UTF-8 file, right?
And so the way they kind of handle that is, you know, you have your 0 to 128.
And so remember, this is, you know, an 8-bit character.
So you have an 8th bit left over, right?
Like you can do, sorry i said zero to 120
it's actually zero to 127 you can do zero to 127 that only that only takes seven bits you have this
eighth bit left over and you know with regular ascii that would be where your extended ascii
would go so if the eighth bit was set true then it it's a number that's 128 or greater.
And they use that to represent pipes and half-filled-in characters, all sorts of kind of weird glyphs, right?
So with Unicode, if that eighth bit is filled in, that tells the Unicode engine that this is a multi-byte character. So that next byte in the file or whatever it is,
is a continuation of the current character. And that's going to unlock all those other characters.
And that idea actually keeps going. So in other words, even the second byte has that option where if that last
bit is set, then that second byte is saying, hey there's even another byte
after me that's representing even some more characters. And that's
kind of the idea behind UTF-8. And so it wastes a bit of space because
you have all these sort of bytes that are just telling you
information instead of being able to represent characters. So it takes more because you have all these sort of bytes that are just telling you information
instead of being able to represent characters.
So it takes more space than like UTF-16
if a bunch of your characters were 16 bit, right?
But if a lot of your characters are just English letters
and only a few of them are sort of that extended format,
then you're actually saving a lot because
in that case that second byte would be just empty a lot.
So it's sort of a trade-off, but the combination of being able to represent ASCII and saving
bytes when you're just showing regular things like spaces and whatnot makes UTF-8 just completely
dominate. whatnot makes utf-8 just completely dominate so i mean something like over 90 percent of the entire
web is in is in either ascii or utf-8 i think the other thing to watch out though is that assumption
where i start off with if you're sort of a c programmer if you look at uh well there's no
strings but if you look at a character array that's five bytes, including the null terminator, because we're good C programmers,
that the that the that's not a four necessarily a four character long string, right? So this is
something that could get baked in. If you're, you know, doing formatting and assuming that,
hey, I have five things in my array, I need to make space for four characters that is you know kind of a bad
assumption because like jason was explaining in utf-8 you could have multiple bytes per displayed
character yep yeah exactly and that's part of internationalization is understanding that that
can happen yeah you don't want to try to do unicode yourself like you don't want to try to do Unicode yourself.
Like you don't want to try to print Unicode characters
using just printf or something like that.
It's going to be a disaster.
Yeah, I guess like an example,
and I've never done this before,
so I don't know how it works,
but trying to think off the top of my head, I guess.
If you required a user to enter exactly a you know 10 character
password and so you saved you know only 11 bytes for that password and someone entered and
and you had the ability to enter utf-8 values you could end up you know sort of truncating
the person's password because you can't save the whole thing right so yeah that's part of understanding this
assumption is saying that oh what's the maximum size something can be given if i know the maximum
number of characters it can be yeah that makes sense it sounds like um i mean like i've never
really done low-level programming.
And so I've always just passed strings around,
not really knowing how many bytes there were under the hood.
But it sounds like this is very, very difficult.
If you're trying to handle a terrestrialization like C
or something like that yourself, it's probably
going to be bad news bears.
But they have, I guess, Un code strings and things like that, right, even in C. Yeah, I mean, I think they're just handled not
in the, I don't know, I don't want to say normal way, that's not the quite right
way of saying that. You just have to take a little bit of special care to make
sure you have the right types. Oh, I see. Got it.
So there's like a Unicode string STL type or something.
Cool.
So yeah, we'll talk about basically some tools that make this very easy.
Like most things, I mean, this is going to be kind of a common motif, but you don't want
to be doing a lot of this yourself. This is one of these
things that there's been a few tools that have kind of risen to the top and kind of occupy,
let's say, 90% of the internationalization effort. And they handle all these different
complexities for you. And if there's some very esoteric need someone just goes in and fills that need in
in one of these libraries so um the most famous is get text um get text is if you if you run any
type of linux you already have get text it's almost impossible to not have get text on the
linux machine i think even os 10 patrick you'd probably correct me if i'm wrong but I think even OS 10, Patrick, you'd probably correct me if I'm wrong, but I think even OS 10 has get text. I've never tried it, so I don't know. Probably. Yeah, so I'm pretty sure.
So get text, it does a bunch of different things, but basically one of the things is whenever you
have a string literal, so imagine if your program just says, you know,
cout, bracket, bracket, you know, hello, I'm a dog or something, right?
So I don't know what made me think of that.
So what you do is with that string literal,
you would put underscore parentheses,
and you would put that string literal in parentheses.
And what that's going to do actually is that's going to invoke a compiler macro so get
text has a compiler macro that's the the macro is underscore so they've kind of
taken that macro and that is going to allow us to sort of swap out that string with something else
and so there's a bunch of other utilities it's not you know entirely done at runtime um
but basically you can write your code with this style and i think it's uh it's n underscore if
you have a number there's a couple of other macros
for different you know things and then uh uh it will uh generate what's called a po file
like a personalization object file and what that's going to do is it's going to say hey here's
the string as you put it which let's say you're an English programmer you would write the string in English like hello I'm a dog in English
and so this PO file will have your string in whatever language you did and
then the next line it'll have a placeholder for you to put the string in
a different language so you'll have a PO file for well assuming you're writing
the code in English you have a PO file for, well, assuming you're writing the code in English, you have a PO file for French and Dutch and German and all these other languages.
And each of those PO files will have all of your strings the way you wrote them.
And then in between them, there'll just be, hey, I want to build the French version.
And get text will do all those substitutions as it's building the code, depending on how your build system is set up.
So in that sense, it's pretty straightforward.
It handles numbers.
It does all that pretty well.
And yeah, it's basically the standard. So that's the first thing you should
try. It's built into Python. It has bindings for PHP and Java and all the other languages.
And that's like the go-to thing. So if for whatever reason you can't use GetText,
check out ICU. ICU is, it's actually pretty common in Java to use ICU instead of get
text but this also supports other languages and yeah those are the two big ones I can think of have you ever had to do any uh internationalization i'm sure i'm probably uh done the opposite i've
probably done horrible bad assumptions in my code um i am exactly the same way no i i don't know
like it's always something i've it's it's forever on my list of i should do better at um i did we did
briefly talk about it at my um previous one of my previous jobs that we were gonna you know sort of
release some stuff in another language and that we needed to you know what was it going to take
to support it but we were also on a very low resource device and so you know the thought of having all of our strings
take twice as long you know twice as many bytes would have put us in a really bad spot already
so we sort of got away with not having to do it at that time um and so makes sense but yeah i i can imagine it's anything from very simple to very complex um i also i think
oh go ahead no no i was gonna say i mean the other thing we we tried to do on that project
was just eliminate as much text as we could from being necessary so using that's a really good
point like icons instead of words yeah Yeah, that totally makes sense.
Yeah, I mean, I think, you know,
the get text thing is pretty simple.
I think, as you said, it gets way harder when you have to deal with like right to left.
Because even, you know, people don't think about this,
but like, you know, even like you have the close button
on the top left, if you're running OS X anyways,
you have the close button on the top left.
That's actually on the top right.
If you're on the right to left mode, like in other words it's not just oh draw the text
it's not like reverse order but it's really like people are used to what we're used to seeing on
the left like table of contents all those things they're used to seeing those on the right and so
the entire user experience has to flip um you know almost like flipping the screen but you
can't you can't just do that because then all the glyphs will be backwards so it's pretty complicated
um but yeah i also i've done almost nothing in this space uh the only thing that i've had to do
is deal with get text problems like when packages won't compile and things like that
because of get text um but yeah i mean it's you know it's super important especially now people
are you know you can release an app on the app store today and and sell that app in like 20 or
30 different countries and uh sometimes it's amazing you know there's been things like orc it orc it's a good example
of something that's just insanely popular in in brazil kind of almost randomly and uh
that could happen to your app and you might end up where your biggest market are
are people in a different country didn't they finally shut down or cut them
they did yeah took a very long time so i didn't
mean to interrupt you but yeah i think you're right like having a strangely popular in another
place thing yeah yeah totally makes a good problem to have yeah i mean as long as you have the get
text then you're good to go cool so yeah i think that covers internationalization um
you know just a as a summary you definitely want to uh you know look into one of these libraries
if you if you know how they work in advance that really is useful because you can kind of
even if you don't internationalize on day one you can kind of structure your app in a good way.
And yeah, we'll see you guys next month with our prize giveaway.
We'll go live for that.
And I'll give you more details about that later on.
Hey, this is Patrick in the editing bay.
We got some submissions for new theme songs. so we're trying them out as outros. This first one is The Tube by Parker Knight. Thank you. Teksting av Nicolai Winther Thank you. The intro music is Axo by Binar Pilot.
Programming Throwdown is distributed under a Creative Commons Attribution Sharealike 2.0 license.
You're free to share, copy, distribute, transmit the work,
to remix, adapt the work, but you must provide attribution
to Patrick and I and share alike in kind.