Localization Academy

How To Run Pseudo Localization In Lokalise

Is Lokalise your favorite TMS? In this tutorial, you’ll learn how to apply pseudolocalization in Lokalise with our instructor Carlos.

Carlos García Gómez 

Hi everybody and welcome to this second tutorial for Lokalise. In this video you’re going to see how to run a pseudo-translation for the key-value pairs that we have uploaded in the first video and you’re also going to see how to export or download the pseudo-translation or the localized file. Let’s dive in.

Okay, so we are in the editor view now where we left in the previous video and what we’re going to do is to run a pseudo-translation or a pseudo-localization as it is called here. What we are going to do is that we’re going to select all the key-value pairs and we’re going to do so with this checkbox. Okay, so instead of just marking them one by one we can do a select all with this checkbox and down here create a task.

We’re going to go down and we’re going to specify pseudo-localize. A pseudo-translation is called a pseudo-localization or a pseudo-localize here in Localize. Now when we specify this task we have the option to increase the length of the text itself.

If we don’t use any value here it’s going to have the same length as per the source and we have the option to add brackets in this pseudo-translation. Now if we click on proceed and then confirm we’re going to run a pseudo-translation or a pseudo-localization in all of the keys, alright? So basically we’re going to see that for each character we’re transforming or for most of the characters because for example some of them like the H might not be changed or the W the same but whenever there is a replacement in another character set when compared to the English one, to the native one we’re going to replace that character with the similar one in another character set. Now that’s useful because when we then export the localized or let’s say the pseudo-localized file we’re going to make sure that the encoding is correct and another good thing here is that we’re going to see that whenever some text has been changed like this that text has been included for translation.

Okay, so it’s a way to check that the file that we are preparing is okay to be translated then afterwards by a linguist. Okay, so something that we can see here and it’s very interesting with localized is that okay, the placeholder has been kept because we shouldn’t actually modify the content of the placeholder and we are only modifying the content that should be translated. The same happens here.

So we have the key and then the English value and the Spanish or the localized value. In this case again we are modifying the text as such and we are keeping the placeholders because those are protected. However, as you can see down here it’s not doing a good job for the context because in the end the context is not fully locked.

Although we can see that the square brackets are here at the very beginning and at the very end and remember that those are not the square brackets that we have here because we have protected those with the, sorry, here because we have protected those with the app or the plugin, the customized placeholders. We can see that it’s basically replaced. Okay, so something that you would like to take into account or consider when running a pseudo-localization with localized is that after you run this task you can use the search here and filter by context and then colon, okay? This is a good way to filter just the specific keys that you then want to run a task only for them.

Okay, and that’s the reason why here for the preprocessing we added context. Otherwise, there’s no way to filter this. Okay, this should be a unique word that then we can use to filter.

Now that we have filtered only these four context values, okay, remember that we only have four context values. So here two, three and four. We can run, now select them all, four keys selected and then we can just run another batch task or another task that is going to be put the source into the target, which is basically copy source to target.

Okay, so we can use this copy function. We can click on confirm and now as you can see the pseudo-translation is gone and we are now back to the original string. Okay, because in the end this is context so it shouldn’t be localized and the same happens in a real-world scenario.

So imagine that the linguist has translated all of these keys and although they can see that this is context and they will see the square brackets, let’s imagine that they have modified the inner text by mistake. Okay, so something that you can do apart from obviously running any QHX that we are not going to cover in this tutorial because we are covering the parsing part. Okay, and the pseudo-translation you can filter by context and then just make sure that you select them all and then copy source to target.

That’s a very good way to specify or to make sure that the context it has not been translated and it has not been modified at all. Okay, so we have this context now as per the source. So now what we are going to do is basically to download the file.

Okay, so we can go to download tab and down here we’re going to specify JSON and we can see the file structure. So we’re going to keep this as per default. Okay, context to export all of the content.

We’re not going to export just a specific keys and then for advanced settings here, you can see some settings. Now something important is the placeholder format. Okay, so here by default we have printtf.

Okay, and we can click on preview. Let’s click on preview and see how it looks like. As you can see this is the source and this is the target.

Okay, the thing is that the placeholders themselves have been removed. Okay, it has been transformed into another type of placeholder because this is the type of placeholder for printf. Now the same happens, for example, if we select, I don’t know, if we select iOS and click on preview we’re going to see that the placeholder is different in the source.

So it modifies the source and then also the target. Okay, that’s the reason why we are actually using the app custom placeholders because if we use this app we need to make sure that we select the raw version. Okay, so placeholder format raw and if we click on preview, we’re going to see this as per the source.

Okay, this is the English and this is what we actually have in the source when we pre-process the file. And if we go to the target, we’re going to see that the placeholders are kept. Okay, this is the good approach.

Let’s say we need to specify raw, otherwise the placeholders are going to be completely gone. All right, so just make sure that you use this option raw and then let’s click on build and download and it’s going to download a zip file. Okay, so let’s go here to the downloads and let me actually get the es es and let me rename it.

Okay, so we have it here in different folders. So let me just rename it underscore es in order to then copy it down here. Okay, so if I now open this file with notepad++ we’re going to see very nicely the difference between these two.

Since it’s a small file, we can use notepad++. If you have bigger files or if you are working with multiple files in batch, you can always use something like beyond compare. Okay, that’s a tool to compare multiple files in batch or even files that are larger than these ones.

Okay, but here we can compare those very nicely and we can see that everything is kept. Okay, so this is all kept in here and the same here. This is kept in here and the same for the context.

The same for the placeholders. We’re only modifying this kind of text. So now what we can do is just this is only a single translation.

Okay, so we don’t actually need to run the post processing for this file, but let me actually show you how you would do it in a real-world scenario because imagine that you have translated for real this file, you have exported the localized Spanish file and then you would like to deliver this file to the client. Obviously, you’re not going to deliver the file with this code and this placeholder here because that’s what we did internally. Okay, it’s something that was not in the source file.

So we need to revert this back. Now something that we can use now is very easy because we can simply specify something like this. So for instance, let me just remove this and let me say here that we have context or code.

Okay, so we are going to specify the structure is the same. All right, so we have the same structure. The only difference is that we either have context or code and then we are going to specify after the colon that we have anything one or more times and then just make it lazy.

Okay, so for now, let me just try it out. Find next. I am actually looking for everything.

Find next. Okay, it’s doing a very good job. Now what we need to do is to use the replacement.

So in the end, we would like to keep only the quote. Okay, we are not specifying the quotes. So we are not going to handle the quotes themselves.

We’re only specifying this part. We’re going to keep only whatever is found here. Okay.

So after the column for the context, we’re going to specify a group and before this curly bracket because in the end we would like to remove this curly bracket and we would like to remove all of this part that we added ourselves. Okay, so we’re going to use this and then in the replacement, we’re going to remove completely everything except for this group. Actually, let me make this first group as a non-capturing group and this way if I use the first group, this is going to be the first group.

Otherwise, if I don’t use this as a non-capturing group, I would need to say two. Okay, because this is the first group and this is the second group. Again, if you want to learn more about regular expressions and you are interested in localization engineering, below this video you’re going to see a link to enroll in the preview course for the localization engineering course and there you’re going to learn some regular expressions.

Then in the full course, you will learn a lot more. So that’s something if you are interested in. Although I’m explaining it here, maybe you would like to go deeper into regular expressions.

So I’m going to specify this as a non-capturing group and I say backslash one to specify only this group. Now if I click on find next and then replace, I’m going to get the string back to the original format. I remove completely the context thing and the placeholder with the curly brackets.

And here if I go find next, I can do the same. So enrollment and the same here. So replace all.

Now we can see that this is, well, we modified the original file. We should have made a copy actually of the original file, but just at least to compare how it was before the preprocessing. But that’s all right, it’s a small file and you noticed you go back actually to the first tutorial, you will see that the original file only had this part.

And that’s why we made those replacements for the preprocessing. So now after you have run the post-processing task or the post-processing replacements, you can save the file and this would be ready to be delivered to the client. Something that you might need to check is the line ending.

So in this case, we can see that localize does not modify the line ending in the background. That’s pretty good for this tool because some other tools actually convert the line ending Unix line fit into Windows carriage return line fit. So it’s very good.

We keep the Unix LF and then the encoding UTF-8. In fact, we can see all of these characters. So that’s pretty much everything for this tutorial.

I hope it has been useful for you and that you get some tricks for the pseudo-translation, the export into the raw format to keep the placeholders and also the post-processing with regular expressions. Thank you for watching this video and I hope to see you in the next tool.

We’re always creating new localization content

Make sure you don’t miss anything. Join 4226 other professionals on our mailing list and be the first to get our upcoming newsletter. 

If you enjoyed that, you’ll love these…