Browse Source

Language change implementation revamped. Didn't work as intended with Arduino IDE.

Caleb Anderson 10 years ago
parent
commit
7db943b147

+ 1
- 1
Marlin/dogm_lcd_implementation.h View File

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

+ 26
- 51
Marlin/language.h View File

1
 #ifndef LANGUAGE_H
1
 #ifndef LANGUAGE_H
2
 #define LANGUAGE_H
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
 // NOTE: IF YOU CHANGE LANGUAGE FILES OR MERGE A FILE WITH CHANGES
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
 // Languages
13
 // Languages
10
 // en English
14
 // en English
21
 // ca Catalan
25
 // ca Catalan
22
 // eu Basque-Euskera
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
 #endif
31
 #endif
31
 
32
 
32
 #define PROTOCOL_VERSION "1.0"
33
 #define PROTOCOL_VERSION "1.0"
33
 
34
 
34
 #if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2)
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
 #elif MB(RUMBA)
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
 #elif MB(3DRAG)
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
 #elif MB(5DPRINT)
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
 #else
47
 #else
47
-	#ifdef CUSTOM_MENDEL_NAME
48
-		#define MACHINE_NAME CUSTOM_MENDEL_NAME
49
-	#else
50
-		#define MACHINE_NAME "Mendel"
51
-	#endif
48
+  #ifdef CUSTOM_MENDEL_NAME
49
+    #define MACHINE_NAME CUSTOM_MENDEL_NAME
50
+  #else
51
+    #define MACHINE_NAME "Mendel"
52
+  #endif
52
 
53
 
53
 // Default firmware set to Mendel
54
 // Default firmware set to Mendel
54
-	#define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/"
55
+  #define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/"
55
 #endif
56
 #endif
56
 
57
 
57
 
58
 
136
 #define MSG_SD_PRINTING_BYTE                "SD printing byte "
137
 #define MSG_SD_PRINTING_BYTE                "SD printing byte "
137
 #define MSG_SD_NOT_PRINTING                 "Not SD printing"
138
 #define MSG_SD_NOT_PRINTING                 "Not SD printing"
138
 #define MSG_SD_ERR_WRITE_TO_FILE            "error writing to file"
139
 #define MSG_SD_ERR_WRITE_TO_FILE            "error writing to file"
139
-#define MSG_SD_CANT_ENTER_SUBDIR 			"Cannot enter subdir: "
140
+#define MSG_SD_CANT_ENTER_SUBDIR      "Cannot enter subdir: "
140
 
141
 
141
 #define MSG_STEPPER_TOO_HIGH                "Steprate too high: "
142
 #define MSG_STEPPER_TOO_HIGH                "Steprate too high: "
142
 #define MSG_ENDSTOPS_HIT                    "endstops hit: "
143
 #define MSG_ENDSTOPS_HIT                    "endstops hit: "
145
 #define MSG_BABYSTEPPING_X                  "Babystepping X"
146
 #define MSG_BABYSTEPPING_X                  "Babystepping X"
146
 #define MSG_BABYSTEPPING_Y                  "Babystepping Y"
147
 #define MSG_BABYSTEPPING_Y                  "Babystepping Y"
147
 #define MSG_BABYSTEPPING_Z                  "Babystepping Z"
148
 #define MSG_BABYSTEPPING_Z                  "Babystepping Z"
148
-#define MSG_SERIAL_ERROR_MENU_STRUCTURE		"Error in menu structure"
149
+#define MSG_SERIAL_ERROR_MENU_STRUCTURE   "Error in menu structure"
149
 
150
 
150
 // LCD Menu Messages
151
 // LCD Menu Messages
151
 
152
 
152
-#if   LANGUAGE_CHOICE == en // English
153
-  #include "language_en.h"
154
-#elif LANGUAGE_CHOICE == pl // Polish
155
-  #include "language_pl.h"
156
-#elif LANGUAGE_CHOICE == fr // French
157
-  #include "language_fr.h"
158
-#elif LANGUAGE_CHOICE == de // German
159
-  #include "language_de.h"
160
-#elif LANGUAGE_CHOICE == es // Spanish
161
-  #include "language_es.h"
162
-#elif LANGUAGE_CHOICE == ru // Russian
163
-  #include "language_ru.h"
164
-#elif LANGUAGE_CHOICE == it // Italian
165
-  #include "language_it.h"
166
-#elif LANGUAGE_CHOICE == pt // Portuguese
167
-  #include "language_pt.h"
168
-#elif LANGUAGE_CHOICE == fi // Finnish
169
-  #include "language_fi.h"
170
-#elif LANGUAGE_CHOICE == an // Aragonese
171
-  #include "language_an.h"
172
-#elif LANGUAGE_CHOICE == nl // Dutch
173
-  #include "language_nl.h"
174
-#elif LANGUAGE_CHOICE == ca // Catalan
175
-  #include "language_ca.h"
176
-#elif LANGUAGE_CHOICE == eu // Basque-Euskera
177
-  #include "language_eu.h"
178
-#endif
153
+#include LANGUAGE_INCLUDE
179
 
154
 
180
 #endif //__LANGUAGE_H
155
 #endif //__LANGUAGE_H

+ 2
- 0
Marlin/language_ru.h View File

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

+ 1
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

198
 
198
 
199
 #else
199
 #else
200
   // Standard directly connected LCD implementations
200
   // Standard directly connected LCD implementations
201
-  #if LANGUAGE_CHOICE == ru
201
+  #ifdef LANGUAGE_RU
202
     #include "LiquidCrystalRus.h"
202
     #include "LiquidCrystalRus.h"
203
     #define LCD_CLASS LiquidCrystalRus
203
     #define LCD_CLASS LiquidCrystalRus
204
   #else 
204
   #else 

Loading…
Cancel
Save