Skip to content

UTF-8 language translation support#5441

Closed
thinkyhead wants to merge 7 commits intoMarlinFirmware:bugfix-1.1.xfrom
thinkyhead:rc_utf8_diff
Closed

UTF-8 language translation support#5441
thinkyhead wants to merge 7 commits intoMarlinFirmware:bugfix-1.1.xfrom
thinkyhead:rc_utf8_diff

Conversation

@thinkyhead
Copy link
Member

@thinkyhead thinkyhead commented Dec 9, 2016

Rebuild of #4704 by @yhfudev

Please review and test.

The last commit is a set of incomplete and uncertain changes. Some of them may actually be reversions of the code to the earlier point where #4704 was created. We need to sort that out.

@yhfudev
Copy link
Contributor

yhfudev commented Dec 9, 2016

@thinkyhead
There're two issues:

  1. the function defined in file ultralcd_impl_HD44780.h is missing, maybe you need to merge the branch RCBugFix?
lcd_implementation_drawmenu_setting_edit_callback_float62
  1. patch:
diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h
index c6a97ec..b8e955f 100644
--- a/Marlin/ultralcd_impl_DOGM.h
+++ b/Marlin/ultralcd_impl_DOGM.h
@@ -572,7 +572,7 @@ static void lcd_implementation_status_screen() {
   if (PAGE_CONTAINS(51 - INFO_FONT_HEIGHT, 49)) {
     lcd_setFont(FONT_MENU);
     lcd_moveto(3, 50);
-    lcd_print(LCD_STR_FEEDRATE[0]);
+    lcd_print_u(LCD_STR_FEEDRATE[0]);
 
     lcd_setFont(FONT_STATUSMENU);
     lcd_moveto(12, 50);

@yhfudev
Copy link
Contributor

yhfudev commented Dec 9, 2016

The language_data_*.h files are similar to the files dogm_font_data_ISO10646_*.h, I suggest not to delete it even it can be generated from the font data. It is for the user to compile the firmware.

@thinkyhead
Copy link
Member Author

thinkyhead commented Dec 9, 2016

lcd_implementation_drawmenu_setting_edit_callback_float62

Ah yes, I forgot about some of those reversions. Thanks for pointing that out.

I suggest not to delete it even it can be generated from the font data. It is for the user to compile the firmware.

Do we need to re-generate these files? If so, we should re-generate them and replace the ones here with the newer generated files.

@thinkyhead
Copy link
Member Author

Are we going to keep language_cn.h, or is it completely replaced by the two new Chinese language files?

@yhfudev
Copy link
Contributor

yhfudev commented Dec 9, 2016

The language_cn.h is for Simplified Chinese only, it was replaced by new files language_zh_CN.h and language_zh_TW.h for Simplified Chinese and Traditional Chinese.

You may leave the language_data_*.h as it and we can re-generate it later once we have this PR done.

@thinkyhead thinkyhead force-pushed the rc_utf8_diff branch 3 times, most recently from 76af0a2 to d4a94dc Compare December 10, 2016 01:58
@thinkyhead
Copy link
Member Author

Finally compiling. Can you give it a test on your display and see if it's good?
https://github.com/thinkyhead/Marlin/archive/rc_utf8_diff.zip

@yhfudev
Copy link
Contributor

yhfudev commented Dec 12, 2016

@thinkyhead
I tested your package, and the display still have problem.

1
3
4

I also merged the latest changes from Marin to my branch: https://github.com/yhfudev/Marlin.git
and my version works. Here's the differences between https://github.com/thinkyhead/Marlin/archive/rc_utf8_diff.zip and https://github.com/yhfudev/Marlin.git

thinkyheadutf8.diff.zip

@yhfudev
Copy link
Contributor

yhfudev commented Dec 12, 2016

The following may fix the arrow problem:

diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h
index d14d24f..58ae728 100644
--- a/Marlin/ultralcd_impl_DOGM.h
+++ b/Marlin/ultralcd_impl_DOGM.h
@@ -657,7 +657,7 @@ static void lcd_implementation_status_screen() {
     if (!PAGE_CONTAINS(row_y1, row_y2)) return;
 
     lcd_printstr_P(pstr, (LCD_WIDTH - (START_COL) - 2) * DOG_CHAR_WIDTH);
-    lcd_moveto(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT));
+    lcd_moveto(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH), row_y2);
 
     lcd_print_u(post_char);
     lcd_print_u(' ');
@@ -679,7 +679,7 @@ static void lcd_implementation_status_screen() {
     const uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
 
     lcd_printstr_P(pstr, (LCD_WIDTH - (START_COL) - 2 - vallen) * DOG_CHAR_WIDTH);
-    lcd_moveto(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH) * vallen, (row + 1) * (DOG_CHAR_HEIGHT));
+    lcd_moveto(LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH) * vallen, row_y2);
 
     pgm ? lcd_printPGM(data) : lcd_print((char*)data);
   }

@thinkyhead
Copy link
Member Author

@yhfudev Feel free to compare and contribute a patch to my branch, if you catch the cause for mis-alignment of the right-side icons.

@yhfudev
Copy link
Contributor

yhfudev commented Dec 13, 2016

What about other commits of the "Update to the current version and also code improvements. thinkyhead#18"?

@thinkyhead
Copy link
Member Author

What about other commits of the "Update to the current version and also code improvements. thinkyhead#18"?

They have all been applied as "fixups" to previous commits using git rebase -i.

@yhfudev
Copy link
Contributor

yhfudev commented Dec 13, 2016

Oh, I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants