Skip to content

Commit 8919773

Browse files
authored
DS Classic Menu: Make calendar weekdays translatable (#2535)
1 parent bf8398a commit 8919773

File tree

6 files changed

+33
-4
lines changed

6 files changed

+33
-4
lines changed

quickmenu/arm9/source/graphics/FontGraphic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ enum class Alignment {
1717
enum class FontPalette {
1818
regular = 0,
1919
disabled = 1,
20-
topBar = 2,
20+
white = 2,
2121
sunday = 3,
2222
saturday = 4,
2323
};

quickmenu/arm9/source/graphics/graphics.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "common/systemdetails.h"
3030
#include "common/twlmenusettings.h"
3131
#include "common/logging.h"
32+
#include "language.h"
3233
#include <cmath>
3334

3435
// Graphic files
@@ -878,7 +879,18 @@ static void calendarTextDraw(const Datetime& now) {
878879

879880
Datetime firstDay(now.getYear(), now.getMonth(), 1);
880881
int startWeekday = firstDay.getWeekDay();
881-
882+
883+
// Draw weekdays
884+
{
885+
printTiny(true, 0*16+8, calendarYPos+20, STR_TWO_LETTER_SUNDAY, Alignment::center, FontPalette::white);
886+
printTiny(true, 1*16+8, calendarYPos+20, STR_TWO_LETTER_MONDAY, Alignment::center, FontPalette::white);
887+
printTiny(true, 2*16+8, calendarYPos+20, STR_TWO_LETTER_TUESDAY, Alignment::center, FontPalette::white);
888+
printTiny(true, 3*16+8, calendarYPos+20, STR_TWO_LETTER_WEDNESDAY, Alignment::center, FontPalette::white);
889+
printTiny(true, 4*16+8, calendarYPos+20, STR_TWO_LETTER_THURSDAY, Alignment::center, FontPalette::white);
890+
printTiny(true, 5*16+8, calendarYPos+20, STR_TWO_LETTER_FRIDAY, Alignment::center, FontPalette::white);
891+
printTiny(true, 6*16+8, calendarYPos+20, STR_TWO_LETTER_SATURDAY, Alignment::center, FontPalette::white);
892+
}
893+
882894
// Draw marker
883895
{
884896
int myPos = (startWeekday + now.getDay() - 1) / 7;
@@ -1246,7 +1258,7 @@ void topBarLoad(void) {
12461258

12471259
char16_t username[11] = {0};
12481260
memcpy(username, useTwlCfg ? (s16 *)0x02000448 : PersonalData->name, 10 * sizeof(char16_t));
1249-
printTiny(true, 3, 3, username, Alignment::left, FontPalette::topBar);
1261+
printTiny(true, 3, 3, username, Alignment::left, FontPalette::white);
12501262
updateTopTextArea(3, 3, calcTinyFontWidth(username), tinyFontHeight(), bmpImageBuffer);
12511263

12521264
drawDateTime(true);
@@ -1260,7 +1272,7 @@ void drawDateTime(bool date, bool showTimeColon) {
12601272
if (!date && !showTimeColon) text[2] = ' ';
12611273

12621274
const int posX = date ? 204 : 172;
1263-
printTinyMonospaced(true, posX, 3, text, Alignment::right, FontPalette::topBar);
1275+
printTinyMonospaced(true, posX, 3, text, Alignment::right, FontPalette::white);
12641276
updateTopTextArea(posX - 27, 3, 27, tinyFontHeight(), bmpImageBuffer);
12651277
}
12661278

quickmenu/arm9/source/language.inl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ STRING(DATE_YEAR_FORMAT, "%m/%Y")
2424
STRING(TIME_FORMAT_12, "%I:%M")
2525
STRING(TIME_FORMAT_24, "%H:%M")
2626

27+
// Two-letter weekday codes
28+
STRING(TWO_LETTER_SUNDAY, "Su")
29+
STRING(TWO_LETTER_MONDAY, "Mo")
30+
STRING(TWO_LETTER_TUESDAY, "Tu")
31+
STRING(TWO_LETTER_WEDNESDAY, "We")
32+
STRING(TWO_LETTER_THURSDAY, "Th")
33+
STRING(TWO_LETTER_FRIDAY, "Fr")
34+
STRING(TWO_LETTER_SATURDAY, "Sa")
35+
2736
// Misc buttons
2837
STRING(B_BACK, "\\B Back")
2938

-244 Bytes
Loading
-255 Bytes
Loading

quickmenu/nitrofiles/languages/en/language.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ DATE_YEAR_FORMAT = %m/%Y
2424
TIME_FORMAT_12 = %I:%M
2525
TIME_FORMAT_24 = %H:%M
2626

27+
TWO_LETTER_SUNDAY=Su
28+
TWO_LETTER_MONDAY=Mo
29+
TWO_LETTER_TUESDAY=Tu
30+
TWO_LETTER_WEDNESDAY=We
31+
TWO_LETTER_THURSDAY=Th
32+
TWO_LETTER_FRIDAY=Fr
33+
TWO_LETTER_SATURDAY=Sa
34+
2735
B_BACK = \B Back
2836

2937
START_FAILED_ERROR = Start failed. Error %i

0 commit comments

Comments
 (0)