diff --git a/build-scripts/get_translation_characters.py b/build-scripts/get_translation_characters.py index 65d5ccaeeac3d..efc018f013303 100755 --- a/build-scripts/get_translation_characters.py +++ b/build-scripts/get_translation_characters.py @@ -7,29 +7,41 @@ import sys from cldr_language_helpers import alphabets + def main(): print("// generated by get_translation_characters.py; example:") - print("// ./build-scripts/get_translation_characters.py en ar cs da de el es fr hu id is it ja ko nb nl pl pt ru sr tr uk_UA zh_Hans zh_Hant > src/cldr/imgui-glyph-ranges.cpp\n") + print("// ./build-scripts/get_translation_characters.py en ar cs da de " + "el es fr hu id is it ja ko nb nl pl pt ru sr tr uk_UA zh_Hans " + "zh_Hant > src/cldr/imgui-glyph-ranges.cpp\n") print("// NOLINTBEGIN(cata-static-declarations,readability-function-size)") try: for language in sys.argv[1:]: print_func(language) - print("// NOLINTEND(cata-static-declarations,readability-function-size)") + print("// NOLINTEND(cata-static-declarations," + "readability-function-size)") return 0 except KeyError as x: print(f"Unknown language code “{x.args[0]}”", file=sys.stderr) return 1 + def print_func(language): - print(f"static void AddGlyphRangesFromCLDRFor{language.upper()}(ImFontGlyphRangesBuilder *b) {{") - print('\n'.join([print_add_char(c) for c in alphabets.ALPHABETS_BY_LANG_MAP[language]])) - print('\n'.join([print_add_char(c.upper()) for c in alphabets.ALPHABETS_BY_LANG_MAP[language]])) - print('\n'.join([print_add_char(c) for c in alphabets.NUMBERS_BY_LANG_MAP[language]])) - print('\n'.join([print_add_char(c) for c in alphabets.PUNCTUATION_BY_LANG_MAP[language]])) + print(f"static void AddGlyphRangesFromCLDRFor{language.upper()}(" + "ImFontGlyphRangesBuilder *b) {{") + print('\n'.join([print_add_char(c) + for c in alphabets.ALPHABETS_BY_LANG_MAP[language]])) + print('\n'.join([print_add_char(c.upper()) + for c in alphabets.ALPHABETS_BY_LANG_MAP[language]])) + print('\n'.join([print_add_char(c) + for c in alphabets.NUMBERS_BY_LANG_MAP[language]])) + print('\n'.join([print_add_char(c) + for c in alphabets.PUNCTUATION_BY_LANG_MAP[language]])) print("}\n") + def print_add_char(c): return '\n'.join([f"b->AddChar({hex(ord(c))});" for c in c]) + if __name__ == '__main__': sys.exit(main()) diff --git a/src/cata_imgui.cpp b/src/cata_imgui.cpp index 1c0f43707e5fc..2ded844ad3b4f 100644 --- a/src/cata_imgui.cpp +++ b/src/cata_imgui.cpp @@ -358,8 +358,7 @@ static void AddGlyphRangesFromCLDR( ImFontGlyphRangesBuilder *b, const std::stri #define UNUSED #endif -static void AddGlyphRangesMisc( UNUSED ImFontGlyphRangesBuilder *b, - UNUSED const std::string &lang ) +static void AddGlyphRangesMisc( UNUSED ImFontGlyphRangesBuilder *b ) { // NOLINTNEXTLINE(modernize-avoid-c-arrays) static ImWchar superscripts[] = { 0x00B9, 0x00B9, 0x00B2, 0x00B3, 0x2070, 0x208E, 0x0000 };