Microsoft MakeCode

(block.loc.LOCALE = blocksyntax) Does (zh-CN) are now supported?

Hello, I use the (block.loc.LOCALE = blocksyntax) function to specify the local language as (zh-CN), but it has no effect, but it is normal to specify as (jp). The following are the codes of (zh-CN) and (jp) respectively:

zh-CN: //% block.loc.zh-CN=“test”

jp: //%“テスト”

(block.loc.LOCALE = blocksyntax) Does (zh-CN) are now supported?

In the case of Chinese, what value should be specified for LOCALE?

Thank you

I can reproduce this in the playground

The docs for this are here

and it looks like zh-CN is the country code in Crowdin for Simplified Chinese.

@peli any thoughts?

Hello @Joel

I have not tried it but it seems a 2 letter code would be required, since it uses a 2 letter code for Japanese.
The 2 letter code for 汉语 is zh

I usually deal with En/Fr translations and I have not tried the inline translation, just the _locale approach.

Thank you for your reply. I tried “zh” but it didn’t work. Specifying LOCALE as es-ES doesn’t take effect either. It may be a problem with “-”

Thanks for the reply, the LOCALE specified as es-ES also cannot take effect, it may be a problem with “-”

Yeah, it’s fairly likely just a regex in the parsing of the failing localization attribute due to the dash – none of our other attributes use that so we might just be checking for valid letters + ‘.’ .

I filed a bug for this, will take a look before the next major release!

1 Like

Hey, I have a question also about using Chinese. This may not be exactly what you are talking about but people in this conversation might know the answer. We have a video out showing Arcade with edge connector and a siren with flashing LED lights. The first words using ‘story’ say that it is a Police Siren in English. I would like our kids to change the words to Police Siren in Chinese on the Meowbit TFT screen. Is there a way to import the Chinese characters for Police Siren into “Story” but keep the rest in English? I suppose we could take a screen grab of the characters from Google Translate and make sprite images of them via Pedersen utility and set those sprites to a position but I was wanting to use text if possible; the code is in the description of the video. Thanks