Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update messages and po files #61

Open
wants to merge 23 commits into
base: mk3-mmu
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
929d9b2
Add double down arrow to be processed correctly
3d-gussner Aug 8, 2022
d08b8b7
Remove PAT9125 stats as these aren't different to IR stats
3d-gussner Aug 9, 2022
8bdb5ff
Remove similar message IR messages
3d-gussner Aug 9, 2022
213bcff
Update config.h translation documentation and move language to group2
3d-gussner Aug 9, 2022
628aef9
lang: Correctly include last element in map file
wavexx Aug 9, 2022
ede35e8
lang: Add inline documentation for the various language macros
wavexx Aug 9, 2022
6b0993f
lang: Add support for raw catalog references with _R
wavexx Aug 9, 2022
e5eaef8
MMU2/lang: Update translatable strings to match our extraction macros
wavexx Aug 9, 2022
49abc39
lang: Fix usage of new non-translated strings
wavexx Aug 9, 2022
209a2ed
lang: Do not check/build obsolete translation entries
wavexx Aug 9, 2022
efda8fe
Use origin message on serial
3d-gussner Aug 10, 2022
7ae837d
Add c= to button messages
3d-gussner Aug 10, 2022
435c100
Prepare progress messages for translation
3d-gussner Aug 10, 2022
8a174d8
Update button menu documentation as there are 1/2/3 options
3d-gussner Aug 10, 2022
af27027
Add sorting to messages.cpp/.h
3d-gussner Aug 10, 2022
e7eb2bf
update mmu2 messages c= r= values
3d-gussner Aug 10, 2022
92fed65
Deduplication
3d-gussner Aug 11, 2022
dca036c
Update POT and PO files
3d-gussner Aug 11, 2022
26a38f1
ByeBye Bondtech
3d-gussner Aug 11, 2022
d435b93
lang: Improve invalid row/column count checks
wavexx Aug 11, 2022
3640295
Remove MSG_M117_V2_CALIBRATION
wavexx Aug 11, 2022
718b687
Add backup for po/Firmware.pot
3d-gussner Aug 12, 2022
c94a4c9
Merge branch 'mk3-mmu' into mk3-mmu-messages
DRracer Aug 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/lang/tmp/
/lang/Firmware-intl.hex
/lang/Firmware-intl-en_*.hex
/lang/*.map

# Temporary files and directories
*[~#]
Expand Down
4 changes: 2 additions & 2 deletions Firmware/Filament_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ void IR_sensor_analog::IR_ANALOG_Check(SensorRevision isVersion, SensorRevision
printf_IRSensorAnalogBoardChange();
switch (switchTo) {
case SensorRevision::_Old:
lcd_setstatuspgm(_T(MSG_FS_V_03_OR_OLDER)); ////MSG_FS_V_03_OR_OLDER c=18
lcd_setstatuspgm(_T(MSG_IR_03_OR_OLDER));
break;
case SensorRevision::_Rev04:
lcd_setstatuspgm(_T(MSG_FS_V_04_OR_NEWER)); ////MSG_FS_V_04_OR_NEWER c=18
lcd_setstatuspgm(_T(MSG_IR_04_OR_NEWER));
break;
default:
break;
Expand Down
11 changes: 8 additions & 3 deletions Firmware/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
//#define LANG_MODE 0 // primary language only
#define LANG_MODE 1 // sec. language support

#define LANG_SIZE_RESERVED 0x3000 // reserved space for secondary language (12288 bytes). Maximum 32768 bytes
#define LANG_SIZE_RESERVED 0x3900 // reserved space for secondary language (14592 bytes).
// 0x3D00 Maximum 15616 bytes as it depends on xflash_layout.h
// 16 Languages max. per group including stock

#if (LANG_SIZE_RESERVED % 256)
#error "LANG_SIZE_RESERVED should be a multiple of a page size"
Expand All @@ -80,9 +82,12 @@
//#define COMMUNITY_LANG_GROUP1_DA // Community Danish language
//#define COMMUNITY_LANG_GROUP1_SL // Community Slovanian language
//#define COMMUNITY_LANG_GROUP1_LB // Community Luxembourgish language
//#define COMMUNITY_LANG_GROUP1_LT // Community Lithuanian language
#endif //COMMUNITY_LANG_GROUP 1

#if (COMMUNITY_LANG_GROUP == 2)
#define COMMUNITY_LANG_GROUP2_LT // Community Lithuanian language
//#define COMMUNITY_LANG_GROUP1_QR // Community new language //..use this as a template and replace 'QR'
#endif
#endif //COMMUNITY_LANG_GROUP 2

#if (COMMUNITY_LANG_GROUP >=1 )
#define COMMUNITY_LANGUAGE_SUPPORT
Expand Down
4 changes: 2 additions & 2 deletions Firmware/language.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ const char* lang_get_name_by_code(uint16_t code)
#ifdef COMMUNITY_LANG_GROUP1_HR
case LANG_CODE_HR: return _n("Hrvatski"); //community Croatian contribution
#endif // COMMUNITY_LANG_GROUP1_HR
#ifdef COMMUNITY_LANG_GROUP1_LT
#ifdef COMMUNITY_LANG_GROUP2_LT
case LANG_CODE_LT: return _n("Lietuviu"); //community Lithuanian contribution
#endif // COMMUNITY_LANG_GROUP1_LT
#endif // COMMUNITY_LANG_GROUP2_LT
#ifdef COMMUNITY_LANG_GROUP1_RO
case LANG_CODE_RO: return _n("Romana"); //community Romanian contribution
#endif // COMMUNITY_LANG_GROUP1_RO
Expand Down
16 changes: 9 additions & 7 deletions Firmware/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
#define PROGMEM_I1 __attribute__((section(".progmem1")))
#define PROGMEM_N1 __attribute__((section(".progmem2")))
#define _I(s) (__extension__({static const char __c[] PROGMEM_I1 = s; &__c[0];}))
#define ISTR(s) s
#define _i(s) _I(s)
#define _T(s) s
#define _O(s) s
#define ISTR(s) (s) // declare a translatable string
#define _i(s) _I(s) // declare a translatable string and return the translated form
#define _T(s) (s) // return translated string from reference
#define _O(s) (s) // return original (untranslated) string from reference
#else //(LANG_MODE == 0)
// section .loc_sec (originaly .progmem0) will be used for localized translated strings
#define PROGMEM_I2 __attribute__((section(".loc_sec")))
Expand All @@ -43,8 +43,10 @@
#define _T(s) lang_get_translation(s)
#define _O(s) (s + 2)
#endif //(LANG_MODE == 0)

#define _N(s) (__extension__({static const char __c[] PROGMEM_N1 = s; &__c[0];}))
#define _n(s) _N(s)
#define _n(s) _N(s) // declare and return untranslated string
#define _R(s) (s) // return reference to translatable string (for warning suppression)
3d-gussner marked this conversation as resolved.
Show resolved Hide resolved

/** @brief lang_table_header_t structure - (size= 16byte) */
typedef struct
Expand Down Expand Up @@ -121,9 +123,9 @@ typedef struct
#ifdef COMMUNITY_LANG_GROUP1_HR
#define LANG_CODE_HR 0x6872 //!<'hr'
#endif // COMMUNITY_LANG_GROUP1_HR
#ifdef COMMUNITY_LANG_GROUP1_LT
#ifdef COMMUNITY_LANG_GROUP2_LT
#define LANG_CODE_LT 0x6C74 //!<'lt'
#endif // COMMUNITY_LANG_GROUP1_LT
#endif // COMMUNITY_LANG_GROUP2_LT
#ifdef COMMUNITY_LANG_GROUP1_SK
#define LANG_CODE_SK 0x736b //!<'sk'
#endif // COMMUNITY_LANG_GROUP1_SK
Expand Down
15 changes: 7 additions & 8 deletions Firmware/messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ const char MSG_STOP_PRINT[] PROGMEM_I1 = ISTR("Stop print"); ////MSG_STOP_PRINT
const char MSG_STOPPED[] PROGMEM_I1 = ISTR("STOPPED."); ////MSG_STOPPED c=20
const char MSG_PINDA_CALIBRATION[] PROGMEM_I1 = ISTR("PINDA cal."); ////MSG_PINDA_CALIBRATION c=13
const char MSG_PINDA_CALIBRATION_DONE[] PROGMEM_I1 = ISTR("PINDA calibration is finished and active. It can be disabled in menu Settings->PINDA cal."); ////MSG_PINDA_CALIBRATION_DONE c=20 r=8
const char MSG_UNLOAD_FILAMENT[] PROGMEM_I1 = ISTR("Unload filament"); ////Number 1 to 5 is added behind text e.g. "Unload filament" c=16
const char MSG_UNLOADING_FILAMENT[] PROGMEM_I1 = ISTR("Unloading filament"); ////c=20
const char MSG_UNLOAD_FILAMENT[] PROGMEM_I1 = ISTR("Unload filament"); ////MSG_UNLOAD_FILAMENT c=16
const char MSG_UNLOADING_FILAMENT[] PROGMEM_I1 = ISTR("Unloading filament"); ////MSG_UNLOADING_FILAMENT c=20
const char MSG_INFO_SCREEN[] PROGMEM_I1 = ISTR("Info screen"); ////MSG_INFO_SCREEN c=18
const char MSG_WIZARD_CALIBRATION_FAILED[] PROGMEM_I1 = ISTR("Please check our handbook and fix the problem. Then resume the Wizard by rebooting the printer."); ////MSG_WIZARD_CALIBRATION_FAILED c=20 r=8
const char MSG_WIZARD_DONE[] PROGMEM_I1 = ISTR("All is done. Happy printing!"); ////MSG_WIZARD_DONE c=20 r=3
Expand Down Expand Up @@ -157,13 +157,12 @@ const char MSG_TIMEOUT[] PROGMEM_I1 = ISTR("Timeout"); ////MSG_TIMEOUT c=12
const char MSG_BRIGHT[] PROGMEM_I1 = ISTR("Bright"); ////MSG_BRIGHT c=6
const char MSG_DIM[] PROGMEM_I1 = ISTR("Dim"); ////MSG_DIM c=6
const char MSG_AUTO[] PROGMEM_I1 = ISTR("Auto"); ////MSG_AUTO c=6
const char MSG_FS_V_03_OR_OLDER[] PROGMEM_I1 = ISTR("FS v0.3 or older"); ////MSG_FS_V_03_OR_OLDER c=18
const char MSG_FS_V_04_OR_NEWER[] PROGMEM_I1 = ISTR("FS v0.4 or newer"); ////MSG_FS_V_04_OR_NEWER c=18
// Beware - the space at the beginning is necessary since it is reused in LCD menu items which are to be with a space
const char MSG_IR_04_OR_NEWER[] PROGMEM_I1 = ISTR(" 0.4 or newer");////c=18
const char MSG_IR_03_OR_OLDER[] PROGMEM_I1 = ISTR(" 0.3 or older");////c=18
const char MSG_IR_UNKNOWN[] PROGMEM_I1 = ISTR("unknown state");////c=18

#if (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG)
const char MSG_IR_04_OR_NEWER[] PROGMEM_I1 = ISTR(" 0.4 or newer");////MSG_IR_04_OR_NEWER c=18
const char MSG_IR_03_OR_OLDER[] PROGMEM_I1 = ISTR(" 0.3 or older");////MSG_IR_03_OR_OLDER c=18
const char MSG_IR_UNKNOWN[] PROGMEM_I1 = ISTR("unknown state");////MSG_IR_UNKNOWN c=18
#endif // (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG)
//not internationalized messages
const char MSG_AUTO_DEPLETE[] PROGMEM_N1 = ISTR("SpoolJoin"); ////MSG_AUTO_DEPLETE c=13
const char MSG_FIRMWARE[] PROGMEM_N1 = ISTR("Firmware"); ////MSG_FIRMWARE c=8
Expand Down
20 changes: 10 additions & 10 deletions Firmware/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ extern const char MSG_LOAD_FILAMENT[];
extern const char MSG_LOAD_TO_BONDTECH[];
extern const char MSG_LOADING_FILAMENT[];
extern const char MSG_TESTING_FILAMENT[];
extern const char MSG_EJECT_FILAMENT[];
extern const char MSG_CUT_FILAMENT[];
extern const char MSG_M117_V2_CALIBRATION[];
extern const char MSG_MAIN[];
extern const char MSG_BACK[];
Expand All @@ -75,7 +77,6 @@ extern const char MSG_NO[];
extern const char MSG_NOZZLE[];
extern const char MSG_PAPER[];
extern const char MSG_PAUSE_PRINT[];
extern const char MSG_PINDA[];
extern const char MSG_PLACE_STEEL_SHEET[];
extern const char MSG_PLEASE_WAIT[];
extern const char MSG_POWER_FAILURES[];
Expand All @@ -89,7 +90,6 @@ extern const char MSG_REMOVE_STEEL_SHEET[];
extern const char MSG_RESET[];
extern const char MSG_RESUME_PRINT[];
extern const char MSG_RESUMING_PRINT[];
extern const char MSG_SD_WORKDIR_FAIL[];
extern const char MSG_SELFTEST_PART_FAN[];
extern const char MSG_SELFTEST_EXTRUDER_FAN[];
extern const char MSG_SELFTEST_FAILED[];
Expand Down Expand Up @@ -127,24 +127,20 @@ extern const char MSG_WIZARD_WELCOME[];
extern const char MSG_WIZARD_WELCOME_SHIPPING[];
extern const char MSG_YES[];
extern const char MSG_V2_CALIBRATION[];
extern const char MSG_WELCOME[];
extern const char MSG_OFF[];
extern const char MSG_ON[];
extern const char MSG_NA[];
extern const char MSG_AUTO_DEPLETE[];
extern const char MSG_CUTTER[];
extern const char MSG_NONE[];
extern const char MSG_WARN[];
extern const char MSG_STRICT[];
extern const char MSG_MODEL[];
extern const char MSG_FIRMWARE[];
extern const char MSG_GCODE[];
extern const char MSG_GCODE_DIFF_PRINTER_CONTINUE[];
extern const char MSG_GCODE_DIFF_PRINTER_CANCELLED[];
extern const char MSG_NOZZLE_DIAMETER[];
extern const char MSG_MMU_MODE[];
extern const char MSG_SD_CARD[];
extern const char MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY[];
extern const char MSG_SORT[];
extern const char MSG_SORT_TIME[];
extern const char MSG_SORT_ALPHA[];
Expand All @@ -167,13 +163,19 @@ extern const char MSG_TIMEOUT[];
extern const char MSG_BRIGHT[];
extern const char MSG_DIM[];
extern const char MSG_AUTO[];
extern const char MSG_FS_V_03_OR_OLDER[];
extern const char MSG_FS_V_04_OR_NEWER[];
#if (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG)
extern const char MSG_IR_04_OR_NEWER[];
extern const char MSG_IR_03_OR_OLDER[];
extern const char MSG_IR_UNKNOWN[];
#endif //(FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG)

//not internationalized messages
extern const char MSG_AUTO_DEPLETE[];
extern const char MSG_FIRMWARE[];
extern const char MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY[];
extern const char MSG_PINDA[];
extern const char MSG_WELCOME[];
extern const char MSG_SD_WORKDIR_FAIL[];
extern const char MSG_BROWNOUT_RESET[];
extern const char MSG_EXTERNAL_RESET[];
extern const char MSG_FILE_SAVED[];
Expand All @@ -195,8 +197,6 @@ extern const char MSG_ENDSTOP_OPEN[];
extern const char MSG_POWERUP[];
extern const char MSG_ERR_STOPPED[];
extern const char MSG_ENDSTOP_HIT[];
extern const char MSG_EJECT_FILAMENT[];
extern const char MSG_CUT_FILAMENT[];
extern const char MSG_OCTOPRINT_PAUSE[];
extern const char MSG_OCTOPRINT_PAUSED[];
extern const char MSG_OCTOPRINT_RESUME[];
Expand Down
33 changes: 4 additions & 29 deletions Firmware/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,6 @@ static const char failStatsFmt[] PROGMEM = "%S\n" " %-16.16S%-3d\n" " %-16.16S%-
//! | Crash X:000 Y:000| MSG_CRASH c=7
//! ----------------------
//! @endcode
//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
static void lcd_menu_fails_stats_total()
{
lcd_timeoutToStatus.stop(); //infinite timeout
Expand All @@ -1254,18 +1253,7 @@ static void lcd_menu_fails_stats_total()
//! | Crash X 000 Y 000| MSG_CRASH c=7
//! ----------------------
//! @endcode
//! @brief Show Last Print Failures Statistics with PAT9125
//!
//! @code{.unparsed}
//! |01234567890123456789|
//! |Last print failures | MSG_LAST_PRINT_FAILURES c=20
//! | Power failures 000| MSG_POWER_FAILURES c=15
//! | Runouts H 000 S 000| MSG_RUNOUTS c=7
//! | Crash X:000 Y:000| MSG_CRASH c=7
//! ----------------------
//! @endcode

//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
//! @todo leptun refactor this piece of code please
static void lcd_menu_fails_stats_print()
{
Expand All @@ -1275,25 +1263,11 @@ static void lcd_menu_fails_stats_print()
uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X);
uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y);
lcd_home();
#if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125
// On the MK3 include detailed PAT9125 statistics about soft failures
lcd_printf_P(PSTR("%S\n"
" %-16.16S%-3d\n"
" %-7.7S: %-3d\n"
" %-7.7S X %-3d Y %-3d"),
_T(MSG_LAST_PRINT_FAILURES),
_T(MSG_POWER_FAILURES), power,
_i("Runouts"), filam, //MSG_RUNOUTS c=7
_T(MSG_CRASH), crashX, crashY);
#elif (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG)
lcd_printf_P(failStatsFmt,
_T(MSG_LAST_PRINT_FAILURES),
_T(MSG_POWER_FAILURES), power,
_T(MSG_FIL_RUNOUTS), filam,
_T(MSG_CRASH), crashX, crashY);
#else
#error This menu should have a filament sensor defined
#endif
menu_back_if_clicked_fb();
}

Expand Down Expand Up @@ -6237,12 +6211,13 @@ static void lcd_control_temperature_menu()
MENU_ITEM_EDIT_int3_P(_T(MSG_BED), &target_temperature_bed, 0, BED_MAXTEMP - 3);
#endif
MENU_ITEM_EDIT_int3_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255);
//@@todo review code below
#if defined AUTOTEMP && (TEMP_SENSOR_0 != 0)
//MENU_ITEM_EDIT removed, following code must be redesigned if AUTOTEMP enabled
MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled);
MENU_ITEM_EDIT(float3, _i(" \xdf Min"), &autotemp_min, 0, HEATER_0_MAXTEMP - 10);////MSG_MIN
MENU_ITEM_EDIT(float3, _i(" \xdf Max"), &autotemp_max, 0, HEATER_0_MAXTEMP - 10);////MSG_MAX
MENU_ITEM_EDIT(float32, _i(" \xdf Fact"), &autotemp_factor, 0.0, 1.0);////MSG_FACTOR
MENU_ITEM_EDIT(float3, _n(" \xdf Min"), &autotemp_min, 0, HEATER_0_MAXTEMP - 10);////MSG_MIN
MENU_ITEM_EDIT(float3, _n(" \xdf Max"), &autotemp_max, 0, HEATER_0_MAXTEMP - 10);////MSG_MAX
MENU_ITEM_EDIT(float32, _n(" \xdf Fact"), &autotemp_factor, 0.0, 1.0);////MSG_FACTOR
#endif

MENU_END();
Expand Down
20 changes: 20 additions & 0 deletions lang/fw-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ rm -rf "$TMPDIR"
mkdir -p "$TMPDIR"
BIN=$TMPDIR/firmware.bin
MAP=$TMPDIR/firmware.map
VARIANT=$(grep '^#define \+PRINTER_TYPE ' "$SRCDIR/Firmware/Configuration_prusa.h"|cut -d '_' -f3)


# Extract and patch the symbol table/language map
color 4 "generating firmware symbol map" >&2
"$OBJCOPY" -I ihex -O binary "$INOHEX" "$BIN"
./lang-map.py "$INOELF" "$BIN" > "$MAP"
cp -f $MAP firmware_$VARIANT.map

# Get the maximum size of a single language table
maxsize=$(grep '^#define \+LANG_SIZE_RESERVED \+' "$SRCDIR/Firmware/config.h" | sed -e 's/\s\+/ /g' | cut -d ' ' -f3)
Expand Down Expand Up @@ -78,8 +81,25 @@ if [ "$has_xflash" = 1 ]; then
color 4 "assembling final firmware image" >&2
"$OBJCOPY" -I binary -O ihex "$BIN" "$OUTHEX"
truncate -s0 "$TMPDIR/lang.bin"
individual_lang_reserved_hex=$(grep --max-count=1 "^#define LANG_SIZE_RESERVED *" $SRCDIR/Firmware/config.h|sed -e's/ */ /g'|cut -d ' ' -f3|cut -d 'x' -f2)
individual_lang_reserved=$((16#$individual_lang_reserved_hex))
for lang in $LANGUAGES; do
cat "$TMPDIR/lang_$lang.bin" >> "$TMPDIR/lang.bin"
lang_size=$(stat -c '%s' "$TMPDIR/lang_$lang.bin")
lang_size_pad=$(( ($lang_size+256-1) / 256 * 256 ))
lang_free=$(($individual_lang_reserved - $lang_size))
echo >&2
echo -n " size usage" >&2
[ $lang_size -gt $individual_lang_reserved ] && c=1 || c=2
color $c " $lang $lang_size_pad ($lang_size)" >&2
echo -n " reserved size " >&2
color 2 "$individual_lang_reserved" >&2
echo -n " free bytes " >&2
color 2 "$lang_free" >&2
if [ $lang_size_pad -gt $individual_lang_reserved ]; then
color 1 "NG! - language $lang data too large" >&2
finish 1
fi
done
"$OBJCOPY" -I binary -O ihex "$TMPDIR/lang.bin" "$TMPDIR/lang.hex"
cat "$TMPDIR/lang.hex" >> "$OUTHEX"
Expand Down
4 changes: 2 additions & 2 deletions lang/lang-extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ def extract_refs(path, catalog):

# match message catalog references to add backrefs
RE_CAT = r'''
(?<!(?:/[/*]|^\s*\#) [^\n]*) # not on a comment or preprocessor
\b (?:_[TO]) \s* \( \s* (\w+) \s* \) # $1 catalog name
(?<!(?:/[/*]|^\s*\#) [^\n]*) # not on a comment or preprocessor
\b (?:_[TOR]) \s* \( \s* (\w+) \s* \) # $1 catalog name
'''

for m in regex.finditer(RE_CAT, source, regex.M|regex.X):
Expand Down
2 changes: 1 addition & 1 deletion lang/lang-map.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_lang_symbols(elf, symtab):
sym_start = sym.entry.st_value
sym_size = sym.entry.st_size
sym_end = sym_start + sym_size
if sym_start >= pri_start and sym_end < pri_end and sym_size > 0:
if sym_start >= pri_start and sym_end <= pri_end and sym_size > 0:
data = text_data[sym_start:sym_end]

# perform basic checks on the language section
Expand Down
1 change: 1 addition & 0 deletions lang/lib/charset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Mapping from LCD source encoding to unicode characters
CUSTOM_CHARS = {
'\x06': '⏬',
'\x04': '🔃',
'\xe4': 'µ',
'\xdf': '°',
Expand Down
2 changes: 1 addition & 1 deletion lang/update-pot.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
# Extract language data in the po subdir to keep the relative paths intact
cd po && ../lang-extract.py --no-missing -s -o Firmware.pot ../../Firmware/[a-zA-Z]*.[ch]*
cd po && ../lang-extract.py --no-missing -s -o Firmware.pot ../../Firmware/[a-zA-Z]*.[ch]* ../../Firmware/mmu2/[a-zA-Z]*.[ch]*