浏览代码

Merge pull request #1267 from RobotCaleb/LanguageFix

Language Fix - Using the new language implementation wasn't behaving as expected.
Bo Herrmannsen 9 年前
父节点
当前提交
67fd8f0727
共有 4 个文件被更改,包括 32 次插入55 次删除
  1. 1
    1
      Marlin/dogm_lcd_implementation.h
  2. 28
    53
      Marlin/language.h
  3. 2
    0
      Marlin/language_ru.h
  4. 1
    1
      Marlin/ultralcd_implementation_hitachi_HD44780.h

+ 1
- 1
Marlin/dogm_lcd_implementation.h 查看文件

@@ -41,7 +41,7 @@
41 41
 
42 42
 /* Russian language not supported yet, needs custom font
43 43
 
44
-#if LANGUAGE_CHOICE == ru
44
+#ifdef LANGUAGE_RU
45 45
 #include "LiquidCrystalRus.h"
46 46
 #define LCD_CLASS LiquidCrystalRus
47 47
 #else

+ 28
- 53
Marlin/language.h 查看文件

@@ -1,10 +1,14 @@
1 1
 #ifndef LANGUAGE_H
2 2
 #define LANGUAGE_H
3 3
 
4
+#define LANGUAGE_CONCAT(M)       #M
5
+#define GENERATE_LANGUAGE_INCLUDE(M)  LANGUAGE_CONCAT(language_##M.h)
6
+
7
+
4 8
 // NOTE: IF YOU CHANGE LANGUAGE FILES OR MERGE A FILE WITH CHANGES
5 9
 //
6
-//   ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h" 
7
-//   ==> ALSO TRY ALL AVAILABLE "LANGUAGE_CHOICE" OPTIONS
10
+//   ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h"
11
+//   ==> ALSO TRY ALL AVAILABLE LANGUAGE OPTIONS
8 12
 
9 13
 // Languages
10 14
 // en English
@@ -21,40 +25,37 @@
21 25
 // ca Catalan
22 26
 // eu Basque-Euskera
23 27
 
24
-#ifndef LANGUAGE_CHOICE
25
-	#define LANGUAGE_CHOICE en  // Pick your language from the list above
26
-#endif
27
-
28
-#if LANGUAGE_CHOICE >= 1
29
-  #error "Languages now uses ISO language codes instead of numbers."
28
+#ifndef LANGUAGE_INCLUDE
29
+  // pick your language from the list above
30
+  #define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en)
30 31
 #endif
31 32
 
32 33
 #define PROTOCOL_VERSION "1.0"
33 34
 
34 35
 #if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2)
35
-	#define MACHINE_NAME "Ultimaker"
36
-	#define FIRMWARE_URL "http://firmware.ultimaker.com"
36
+  #define MACHINE_NAME "Ultimaker"
37
+  #define FIRMWARE_URL "http://firmware.ultimaker.com"
37 38
 #elif MB(RUMBA)
38
-	#define MACHINE_NAME "Rumba"
39
-	#define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/"
39
+  #define MACHINE_NAME "Rumba"
40
+  #define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/"
40 41
 #elif MB(3DRAG)
41
-	#define MACHINE_NAME "3Drag"
42
-	#define FIRMWARE_URL "http://3dprint.elettronicain.it/"
42
+  #define MACHINE_NAME "3Drag"
43
+  #define FIRMWARE_URL "http://3dprint.elettronicain.it/"
43 44
 #elif MB(5DPRINT)
44
-	#define MACHINE_NAME "Makibox"
45
-	#define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/"
45
+  #define MACHINE_NAME "Makibox"
46
+  #define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/"
46 47
 #elif MB(SAV_MKI)
47
-	#define MACHINE_NAME "SAV MkI"
48
-	#define FIRMWARE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config"
48
+  #define MACHINE_NAME "SAV MkI"
49
+  #define FIRMWARE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config"
49 50
 #else
50
-	#ifdef CUSTOM_MENDEL_NAME
51
-		#define MACHINE_NAME CUSTOM_MENDEL_NAME
52
-	#else
53
-		#define MACHINE_NAME "Mendel"
54
-	#endif
51
+  #ifdef CUSTOM_MENDEL_NAME
52
+    #define MACHINE_NAME CUSTOM_MENDEL_NAME
53
+  #else
54
+    #define MACHINE_NAME "Mendel"
55
+  #endif
55 56
 
56 57
 // Default firmware set to Mendel
57
-	#define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/"
58
+  #define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/"
58 59
 #endif
59 60
 
60 61
 
@@ -139,7 +140,7 @@
139 140
 #define MSG_SD_PRINTING_BYTE                "SD printing byte "
140 141
 #define MSG_SD_NOT_PRINTING                 "Not SD printing"
141 142
 #define MSG_SD_ERR_WRITE_TO_FILE            "error writing to file"
142
-#define MSG_SD_CANT_ENTER_SUBDIR 			"Cannot enter subdir: "
143
+#define MSG_SD_CANT_ENTER_SUBDIR            "Cannot enter subdir: "
143 144
 
144 145
 #define MSG_STEPPER_TOO_HIGH                "Steprate too high: "
145 146
 #define MSG_ENDSTOPS_HIT                    "endstops hit: "
@@ -148,36 +149,10 @@
148 149
 #define MSG_BABYSTEPPING_X                  "Babystepping X"
149 150
 #define MSG_BABYSTEPPING_Y                  "Babystepping Y"
150 151
 #define MSG_BABYSTEPPING_Z                  "Babystepping Z"
151
-#define MSG_SERIAL_ERROR_MENU_STRUCTURE		"Error in menu structure"
152
+#define MSG_SERIAL_ERROR_MENU_STRUCTURE     "Error in menu structure"
152 153
 
153 154
 // LCD Menu Messages
154 155
 
155
-#if   LANGUAGE_CHOICE == en // English
156
-  #include "language_en.h"
157
-#elif LANGUAGE_CHOICE == pl // Polish
158
-  #include "language_pl.h"
159
-#elif LANGUAGE_CHOICE == fr // French
160
-  #include "language_fr.h"
161
-#elif LANGUAGE_CHOICE == de // German
162
-  #include "language_de.h"
163
-#elif LANGUAGE_CHOICE == es // Spanish
164
-  #include "language_es.h"
165
-#elif LANGUAGE_CHOICE == ru // Russian
166
-  #include "language_ru.h"
167
-#elif LANGUAGE_CHOICE == it // Italian
168
-  #include "language_it.h"
169
-#elif LANGUAGE_CHOICE == pt // Portuguese
170
-  #include "language_pt.h"
171
-#elif LANGUAGE_CHOICE == fi // Finnish
172
-  #include "language_fi.h"
173
-#elif LANGUAGE_CHOICE == an // Aragonese
174
-  #include "language_an.h"
175
-#elif LANGUAGE_CHOICE == nl // Dutch
176
-  #include "language_nl.h"
177
-#elif LANGUAGE_CHOICE == ca // Catalan
178
-  #include "language_ca.h"
179
-#elif LANGUAGE_CHOICE == eu // Basque-Euskera
180
-  #include "language_eu.h"
181
-#endif
156
+#include LANGUAGE_INCLUDE
182 157
 
183 158
 #endif //__LANGUAGE_H

+ 2
- 0
Marlin/language_ru.h 查看文件

@@ -8,6 +8,8 @@
8 8
 #ifndef LANGUAGE_RU_H
9 9
 #define LANGUAGE_RU_H
10 10
 
11
+#define LANGUAGE_RU
12
+
11 13
 #define WELCOME_MSG                         MACHINE_NAME "Готов."
12 14
 #define MSG_SD_INSERTED                     "Карта вставлена"
13 15
 #define MSG_SD_REMOVED                      "Карта извлечена"

+ 1
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h 查看文件

@@ -199,7 +199,7 @@ extern volatile uint16_t buttons;  //an extended version of the last checked but
199 199
 
200 200
 #else
201 201
   // Standard directly connected LCD implementations
202
-  #if LANGUAGE_CHOICE == ru
202
+  #ifdef LANGUAGE_RU
203 203
     #include "LiquidCrystalRus.h"
204 204
     #define LCD_CLASS LiquidCrystalRus
205 205
   #else 

正在加载...
取消
保存