There are two hard problems in computer science, cache infiltration, naming things, and off-by-one errors. Naming things are one of the things we engineers always find challenging. The first one is the cognitive load. If we have a JSON dictionary structure, what kind of naming structure do we want? Should it be categorized by page, pages.buttons.save? Or should it be categorized by the feature inside each page, so page.createUserForm.save? Or should it even be extracted into its own group, like common.buttons.save? These are cognitive load that we have to deal with. This is also prone to being inconsistent. Like for example, we have a naming scheme, we agree to it, but then we kind of forget in a minute like, what was that again? Is it buttons.save or is it like undercommon.buttons.save? Those are the pain about naming things. The second one is the context is lost when you're using a JSON dictionary. With the JSON dictionary, the translators need to understand how you structure your app and then infer from there. As an example, if we have this translation file for a game, we have like two keys that are called save. One is inside user actions and the other is just on top. Translator not knowing the context, they would guess, okay, they both mean the same thing. They want to save the changes like in a form. So they choose in this case, the Japanese word, hōzōn. But for example, in this case, the app could mean a different thing. Like what do you want under user actions. Save is not to save changes in a form, but like to rescue a person in the game, because this is like a game translation. So the translations are supposed to be different, but the translator needs to know that this is different just from reading the keys, which is not very intuitive.
Third one is duplicate wordings. It's easy to accidentally make duplicate translations across different keys. As an example here, we can have like a model button, form action, user profile. We would make different keys like if we group them by features, we would make different keys that basically need the exact same word. And in this case, we can see that there are a lot of duplications, but some people might say, we can just extract them to a common group. Like cancel is a very commonly used word. And that 's true, but that 's more cognitive. Like when do you start extracting these words? Do you start when you find the first duplication? Is it too much work? Do you start from the second duplication? You have to manually check and extract them. You have to remember to use the common key next time. If you forget that you have already extracted, you might accidentally use the existing key.
The fourth thing is the obsolete translations. Let's say like after you developed your project for one year, the key structure has changed. You want to refactor the key from one to another.
Comments