# Translating art

**URL:** https://forums.thimbleweedpark.com/t/translating-art/4311
**Category:** Delores Engine
**Created:** [May 28, 2020, 4:52pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311 "2020-05-28T16:52:19Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![RonGilbert](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/rongilbert/32/7_2.png) [@RonGilbert](https://forums.thimbleweedpark.com/u/RonGilbert)
#### Post date: [May 28, 2020, 4:52pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/1 "2020-05-28T16:52:19Z")

</div>

Download the engine again, make sure you are running 1.0.3 or above.

Use the new `setLanguage(name)` to set the language name. `name` should be the 2-letter code like `en` or `it` or `es`.

Change this function to…

```auto
function useTranslation(language) {
	translation_table = language ? loadtsvtable("Translations_"+language+".tsv") : null
 	setLanguage(translation_table ? language : "en")
	// dumpvar(translation_table)	// Uncomment to dump the table
	return translation_table ? YES : NO
}

```

If you have `.png` called `foobar_en.png` and another called `foobar_it.png` it will automatically choose the `_it` version if the language is set to `it`. All reference in `.dinky` code or `.wimpy` files must be `_en.png`. The translated `.png` will be used automatically if found.

If you’ve modified any `.wimpy` (or altered code) to use `_it.png` files, revert out of that code and the engine should do all the work for you.

Some of the art already has these, so just doing this code change should show a few of them.

Let me know if you have any issues, the feature has had no real testing in Delores. There is one other change I’ll make if this works for you is auto detecting the language of the machine. The intro ref card image should get a `_en` on it and then the` _it` version will show on launch (once I make the additional change).

---

<div class="post-metadata">

### Author: ![Guga](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/guga/32/14476_2.png) [@Guga](https://forums.thimbleweedpark.com/u/Guga)
#### Post date: [May 28, 2020, 8:13pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/2 "2020-05-28T20:13:44Z")

</div>

I’ll try it ASAP.

If I understood correctly, now changing a frame name from foo to foo\_en makes it “visible” to the translation system? So, e.g., the QuickiePalOutside.wimpy file has an object with a state that shows a frame called “front\_signs\_text\_en”, if the language is set to “it” then it will automatically load the \_it file from the spritesheet?

---

<div class="post-metadata">

### Author: ![RonGilbert](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/rongilbert/32/7_2.png) [@RonGilbert](https://forums.thimbleweedpark.com/u/RonGilbert)
#### Post date: [May 28, 2020, 8:24pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/3 "2020-05-28T20:24:18Z")

</div>

That is correct. But keep in mind, if you want the translation released with our next update, resist the urge go through add a lot of new frames. Each of those will have to be hand-added back to the .psd file and in the correct format with all the right tagging. When we do a build for a store, we don’t use the .png files, they are all deleted then the automated pipeline is run that extracts the .pngs from the .psd file.

Many of the .psd files already have \_en, \_it, etc images in them. Any new images need to be organized, grouped and labeled in the .psd exactly like existing ones or they won’t be extracted.

---

<div class="post-metadata">

### Author: ![Guga](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/guga/32/14476_2.png) [@Guga](https://forums.thimbleweedpark.com/u/Guga)
#### Post date: [May 28, 2020, 8:30pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/4 "2020-05-28T20:30:01Z")

</div>

I’ll stick to the important ones (i.e. the text-heavy, like the intro screen) and try to work on them on the .psd files.

However, I can’t get the Quickie Pal to turn to Italian, even if the current language is Italian and the images are already there (the frames already have the \_en suffix). Shouldn’t it work directly out of the box?

---

<div class="post-metadata">

### Author: ![RonGilbert](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/rongilbert/32/7_2.png) [@RonGilbert](https://forums.thimbleweedpark.com/u/RonGilbert)
#### Post date: [May 28, 2020, 8:38pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/5 "2020-05-28T20:38:34Z")

</div>

It should. The system hasn’t gotten a lot of testing since TWP since we didn’t use it on Delores. My quick test showed it working, but it might fail. Let me look closer at that one instace.

---

<div class="post-metadata">

### Author: ![Guga](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/guga/32/14476_2.png) [@Guga](https://forums.thimbleweedpark.com/u/Guga)
#### Post date: [May 28, 2020, 8:42pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/6 "2020-05-28T20:42:07Z")

</div>

> [@RonGilbert](#):
>
> ```auto
> function useTranslation(language) {
> translation_table = language ? loadtsvtable("Translations_"+language+".tsv") : null
> setLanguage(translation_table ? language : "en")
> // dumpvar(translation_table)	// Uncomment to dump the table
> return translation_table ? YES : NO
> }
> 
> ```

Sorry, my bad. I thought this was already in the newest code, but it’s not. I’m still using the old useTranslation

---

<div class="post-metadata">

### Author: ![RonGilbert](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/rongilbert/32/7_2.png) [@RonGilbert](https://forums.thimbleweedpark.com/u/RonGilbert)
#### Post date: [May 28, 2020, 8:42pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/7 "2020-05-28T20:42:33Z")

</div>

I show it working…

 ![ScreenShot](https://canada1.discourse-cdn.com/flex030/uploads/thimbleweedpark/original/2X/c/c1421ccae30b058ed28f37a7a328978ceef5344d.png)

There is some garbage, probably due to other layers not being changed, but it seems to switch.

---

<div class="post-metadata">

### Author: ![RonGilbert](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/rongilbert/32/7_2.png) [@RonGilbert](https://forums.thimbleweedpark.com/u/RonGilbert)
#### Post date: [May 28, 2020, 8:43pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/8 "2020-05-28T20:43:56Z")

</div>

> [@Guga](#):
>
> Sorry, my bad. I thought this was already in the newest code, but it’s not. I’m still using the old useTranslation

I’ll update the repro. I was waiting until your team had a change to test it out.

---

<div class="post-metadata">

### Author: ![Guga](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/guga/32/14476_2.png) [@Guga](https://forums.thimbleweedpark.com/u/Guga)
#### Post date: [May 28, 2020, 8:44pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/9 "2020-05-28T20:44:06Z")

</div>

> [@RonGilbert](#):
>
> There is some garbage

Yes, the background layer stays in English. I already changed that in my branch, I’ll fix it.

It works, anyway. I changed the function and it works as expected. Thanks a lot!

---

<div class="post-metadata">

### Author: ![Nor\_Treblig](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/nor_treblig/32/216_2.png) [@Nor\_Treblig](https://forums.thimbleweedpark.com/u/Nor_Treblig)
#### Post date: [May 28, 2020, 11:59pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/10 "2020-05-28T23:59:18Z")

</div>

One questions about the sprite sheets:

Would it make sense to allow loading additional sheets to existing ones, which would allow adding new sprites or replacing existing sprites without the need to change the whole base sprite sheet?  
This would make adding new translations easier, especially when we are talking about a finished game.

But maybe this makes the engine unnecessary complex?

Here is an example what I mean:

1. _QuickiePal.json_ is loaded, adding sprites from _QuickiePal.png_ like _background_, _foreground_, _Welcome\_text\_en_, Welcome\_text\_de\* etc.
2. Then _QuickiePal\_ **{lang}**.json_ is loaded, possibly overriding sprites from the base sprite sheet, e.g.:  
_QuickiePal\_ **cz**.json_ reads _QuickiePal\_ **cz**.png_ and **adds** sprite _Welcome\_text\_cz_ and **overrides** sprite _foreground_

(implementation detail: the language specific one(s) might be loaded first)

(if this feature of _overriding existing sprites_ makes changing of translations complicated we could live without it of course, BUT it would be nice feature for modding in general)

---

<div class="post-metadata">

### Author: ![RonGilbert](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/rongilbert/32/7_2.png) [@RonGilbert](https://forums.thimbleweedpark.com/u/RonGilbert)
#### Post date: [May 29, 2020, 1:46am UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/11 "2020-05-29T01:46:44Z")

</div>

As of now, the system doesn’t support multiple sprite sheets/room. If we were adding a lot of languages after release, it might make sense, but everything is built with a big pipeline so it doesn’t matter much and it’s a lot easier/safer to just rebuild everything. It’s a trade off on how much work we do to support something that is unlikely to happen in a real life.

That said, I have wanted to support multiple sprite sheets just because they can offer better packing.

---

<div class="post-metadata">

### Author: ![Nor\_Treblig](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/nor_treblig/32/216_2.png) [@Nor\_Treblig](https://forums.thimbleweedpark.com/u/Nor_Treblig)
#### Post date: [May 29, 2020, 2:11am UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/12 "2020-05-29T02:11:22Z")

</div>

I see, thx.

> [@RonGilbert](#):
>
> something that is unlikely to happen in a real life

It happened in real-life 🙂  
I was thinking about unofficial TWP translations when I wrote this. And mods better working together with other mods.

---

<div class="post-metadata">

### Author: ![RonGilbert](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/rongilbert/32/7_2.png) [@RonGilbert](https://forums.thimbleweedpark.com/u/RonGilbert)
#### Post date: [May 29, 2020, 2:59pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/13 "2020-05-29T14:59:25Z")

</div>

I guess I meant “in an actual production”. You are right, something like this would help with mods, and if we ever build a game meant to be modded, I would absolutely look at something like this. Over the years, my code is riddled with features I thought would be important and never were, so now I try and build features where there is an actual immediate use.

---

<div class="post-metadata">

### Author: ![Guga](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/guga/32/14476_2.png) [@Guga](https://forums.thimbleweedpark.com/u/Guga)
#### Post date: [May 30, 2020, 10:11am UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/14 "2020-05-30T10:11:24Z")

</div>

> [@RonGilbert](#):
>
> There is some garbage, probably due to other layers not being changed, but it seems to switch.

I played around trying to understand why it doesn’t work, and it seems like the system is only translating on the fly the frame called `front_signs_neon_text_en`.

If I add this to other props or objects, even unchanged, I get the Italian image.

But I tried then with `front_signs_text_en`, `maps_banner_lit_text_en` and they don’t work. Interestingly enough, `maps_banner_text_en` works fine.

---

<div class="post-metadata">

### Author: ![Guga](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/guga/32/14476_2.png) [@Guga](https://forums.thimbleweedpark.com/u/Guga)
#### Post date: [May 30, 2020, 2:54pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/15 "2020-05-30T14:54:47Z")

</div>

@RonGilbert while we’re at it, can you share the script you use to extract the images from the .psd files and obtain the texture packs? There’s only the one that packs all PNGs, but nothing for psd. As I’d like to begin with the images, I want to be sure that I’m doing the things the correct way.

---

<div class="post-metadata">

### Author: ![RonGilbert](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/rongilbert/32/7_2.png) [@RonGilbert](https://forums.thimbleweedpark.com/u/RonGilbert)
#### Post date: [May 30, 2020, 3:12pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/16 "2020-05-30T15:12:20Z")

</div>

I’ll check them into the repo in a subfolder of bin. They are all python, so with a little work you should be able get them working.

For the \_en.png to be translated, the \_en.png must be attached to an object and that must appear in the .wimpy file. I haven’t looked at those specifically to see what might be wrong.

---

<div class="post-metadata">

### Author: ![Guga](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/guga/32/14476_2.png) [@Guga](https://forums.thimbleweedpark.com/u/Guga)
#### Post date: [May 30, 2020, 3:52pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/17 "2020-05-30T15:52:07Z")

</div>

> [@RonGilbert](#):
>
> For the \_en.png to be translated, the \_en.png must be attached to an object and that must appear in the .wimpy file

I tried with the quickie pal lights. The same object changes correctly if I use the “lit text” name, and if I use the “unlit maps banner”, but doesn’t if I use the unlit text or the lit maps banner. It seems like some frame names don’t get recognized by the translation system

---

<div class="post-metadata">

### Author: ![ZakPhoenixMcKracken](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/zakphoenixmckracken/32/41_2.png) [@ZakPhoenixMcKracken](https://forums.thimbleweedpark.com/u/ZakPhoenixMcKracken)
#### Post date: [May 30, 2020, 3:58pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/18 "2020-05-30T15:58:23Z")

</div>

ON:  
 ![immagine](https://canada1.discourse-cdn.com/flex030/uploads/thimbleweedpark/original/2X/9/941ff08482680c65497ccb00d0f291f6de242b8d.png)

OFF:  
 ![immagine](https://canada1.discourse-cdn.com/flex030/uploads/thimbleweedpark/original/2X/e/e56018d5639fb9d3a935f3d15b6af88c8f128bdb.png)

(“FOOD-BEER” should be “CIBO-BIRRA”)

---

<div class="post-metadata">

### Author: ![RonGilbert](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/rongilbert/32/7_2.png) [@RonGilbert](https://forums.thimbleweedpark.com/u/RonGilbert)
#### Post date: [May 30, 2020, 4:18pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/19 "2020-05-30T16:18:08Z")

</div>

Can you give me the exact name of the .png that isn’t being translated correctly?

---

<div class="post-metadata">

### Author: ![RonGilbert](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.thimbleweedpark.com/rongilbert/32/7_2.png) [@RonGilbert](https://forums.thimbleweedpark.com/u/RonGilbert)
#### Post date: [May 30, 2020, 4:35pm UTC](https://forums.thimbleweedpark.com/t/translating-art/4311/20 "2020-05-30T16:35:24Z")

</div>

Never mind, I got it to repro. Let me look into what is happening.

[Next page](https://forums.thimbleweedpark.com/t/translating-art/4311.md?page=2)
