drachels / moodle-mod_mootyper

4 stars 18 forks source link

chinese can't be added in the exercises #61

Closed hznupeter closed 6 years ago

hznupeter commented 6 years ago

moodle version:3.5 mootyper version:3.5.1 server version : centos 7.2

First,thanks for what you did,mootyper is a good module for me. But ,when i add chinese in the exercise ,it will become red.(as below) and i try another way: edit the lesson txet in the source code,but it still can't work. tim 20180602095405

can you tell me how to fix it? and i have translate mootyper into chinese ,i hope i can pull it to your work.

drachels commented 6 years ago

The Chinese you are trying to enter is red because the alphabet is not in line 95 of eedit.php and any extra special characters is line 106 thru 112 when editing a lesson. They are also red when trying to create an exercise because the alphabet is not in line 150 of eins.php and any extra special characters in line 162 thru 167.

Have you created a keyboard layout (a php file) and driver (a javascript file) for Chinese? You will need them also.

hznupeter commented 6 years ago

Chinese characters are different from other languages, there are too many characters in chinese,more than 3000.

drachels commented 6 years ago

That's what I thought But, I do wonder if one of the simplified versions (Simplified China or Simplified Singapore) was what you were trying to use, and if either one of those could be adapted to work.

hznupeter commented 6 years ago

yeah,what i use is ZH_CN version, Simplified Chinese .Can you tell me more details to make it .

drachels commented 6 years ago

You will need to create two files, chinese.js and chinese.php. The js file is the keyboard driver file and the php is the keyboard layout file. Generally, when I try to create a set of files for a new language, I copy two existing files and just rename them. I then go through the php file and replace the display character with the corresponding character from the new language. I then modify the js file so that it types the correct letter when the correct key is used on the physical keyboard. The two files eins.php and eedit.php will also need any missing characters added. With most languages, I can get away with just adding the first and last character of the alphabet, (e.g. a-z) but sometimes I have to individually add special characters, such as ones with accent marks. The problem I see with trying to adapt a set of files for Chinese, after trying out the MS Windows 10 keyboard driver for, Chinese(Simplified, China) Microsoft Pinyin, and the one for Chinese (traditional, Taiwan) Microsoft Bopomofo, is that even without using Shift, Alt, Ctrl, or other extra keys, each key cycles through a list of characters. This will probably require some additional fancy css to duplicate what you need.

By the way, do you have a picture of a Chinese keyboard you could send me? drachels@drachels.com