Where to set the translation of "not found" in 'look up in pairs' block?

where to set the translation of "not found" in 'look up in pairs' block and 'get value for key'?
I can not found it in 'messages_zh_CN.json'.

QQ截图20220320200451

1 Like

Do you mean Weblate or GitHub? I can't find them in both.

I mean in my own clone / offline version.

There you go. Have fun.

maybe i did not explain myself good.
I know where is this file, but in this file, no entry for translation of 'not found', maybe in other file, but I don't know which one.

Hmm...that is the only JSON file that has all Mainland Chinese translations. I cannot find something for that in the file, not even in the original App Inventor.

:de: German:

image

:fr: French:

image

1 Like

and one more
QQ截图20220320204428

'add item to list' block looks good in drawer, but after drag out, it because English again...

Why?

3 Likes

It seems that the "not found" block is being added to the drawer without any translation. I found the code here:

3 Likes

Thank you @yusufcihan.
So if I change the 'not found ' here to Chinese, it will always show Chinese even if I change the UI to English later.

1 Like

Yeah, because the string is constant.

However, you should be able to reference Blockly translations in most places with using %{BKY_...} strings. I'm not sure if that works for App Inventor too (as they use a different version of Blockly - and I don't know if that works for drawers), but I will explain anyway, so you can test if it works.

Can you try adding a new translation key like,

Blockly.Msg["LANG_DICTIONARIES_NOT_FOUND"] = "not found";

And changing the XML from:

<title name="TEXT">not found</title>

to:

<title name="TEXT">%{BKY_LANG_DICTIONARIES_NOT_FOUND}</title>
3 Likes

OK i will try tomorrow. Thanks.

1 Like

thanks @yusufcihan.
It's working, just change to like this:

...<title name="TEXT">' + Blockly.Msg.NOTFOUND + '</title>...

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.