Monday, January 16, 2017

Not making a change that would have made no sense

Like most applications, Tableau supports several languages.  Here's a quick screenshot of what we currently offer:

No big surprise here: we keep a list of all the text (strings) that we use in our application in a file, and localize (translate) them into each language. 

For instance, we have the color "Blue" in our UI in many places.  In Spanish, that will be "Azul".  So we have a file that has a string number (let’s say "String1447") and that string number points to several translations of "Blue." 

What we try to do - and this is pretty much the standard way of providing multiple language support - is to never refer to the text "blue".  Instead, whenever we want that word to show, we ask for the correct translation of "String1447" - which in English will be "Blue," in Spanish "azul," etc… 

So if I am looking at a color palette on an English machine, when I hover over the Blue color, the UI asks for the English translation of "String1447" and shows me "Blue." 

I was looking through our string table the other day to see if there was any way to make the process of using it more efficient.  One thing that jumped out at me was that we have several different entries for "Blue" (and "Green" and "Brown" and other colors).  That struck me as odd - why do we need to have all these duplicates?  If we just had one string ("String1447") for Blue, we could have smaller files, less build time, less confusion with knowing which string to use and so on.

So my first thought was to remove all the duplicated strings.

When I looked a little deeper though, I noticed that each color palette we have has its own list of colors.  An example would be the Summer palette.  Blue is near the bottom on my machine:

Another instance would be the Tableau 10 colors:

In the strings file, each color palette has its own list of colors.  There are 8 colors listed for Summer and 10 for Tableau 10 which makes sense.  If I am working with the Summer palette, I would naturally want to use a string name of "Summer_Blue" or similar, naturally want to refer to "String_Summer_Blue" or similar.  And if I was working with the Tableau_10 color palette, I would want to use "String_Tableau_10_Blue". 

My original plan was to replace these with something like "String_Just_Blue" (heh) or "String_Blue" and simply use this string everywhere that we need.  But that plan was shelved pretty quickly since it would make our strings table hard to read.  If the list of 10 colors for the "Tableau 10" palette only listed 6 (because of duplicate strings being removed) then everyone would find it confusing.

So my investigation into making files smaller here would have resulted in a system that is more confusing than what we currently have.  So I am not making this change and moving on to other work.

Questions, comments, concerns and criticisms always welcome,

No comments:

Post a Comment