feat: Full UI internationalization, pool hashrate stats, and layout caching
- Replace all hardcoded English strings with TR() translation keys across every tab, dialog, and component (~20 UI files) - Expand all 8 language files (de, es, fr, ja, ko, pt, ru, zh) with complete translations (~37k lines added) - Improve i18n loader with exe-relative path fallback and English base fallback for missing keys - Add pool-side hashrate polling via pool stats API in xmrig_manager - Introduce Layout::beginFrame() per-frame caching and refresh balance layout config only on schema generation change - Offload daemon output parsing to worker thread - Add CJK subset fallback font for Chinese/Japanese/Korean glyphs
This commit is contained in:
@@ -481,17 +481,36 @@ elseif(EXISTS ${CMAKE_SOURCE_DIR}/../SilentDragonX/res/Ubuntu-R.ttf)
|
||||
)
|
||||
endif()
|
||||
|
||||
# Copy language files
|
||||
# Copy language files at BUILD time (not just cmake configure time)
|
||||
# so edits to res/lang/*.json are picked up by 'make' without re-running cmake.
|
||||
file(GLOB LANG_FILES ${CMAKE_SOURCE_DIR}/res/lang/*.json)
|
||||
if(LANG_FILES)
|
||||
foreach(LANG_FILE ${LANG_FILES})
|
||||
get_filename_component(LANG_FILENAME ${LANG_FILE} NAME)
|
||||
configure_file(
|
||||
${LANG_FILE}
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/res/lang/${LANG_FILENAME}
|
||||
COPYONLY
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/res/lang/${LANG_FILENAME}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${LANG_FILE}
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/res/lang/${LANG_FILENAME}
|
||||
DEPENDS ${LANG_FILE}
|
||||
COMMENT "Copying ${LANG_FILENAME}"
|
||||
)
|
||||
list(APPEND LANG_OUTPUTS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/res/lang/${LANG_FILENAME})
|
||||
|
||||
# Also regenerate the embedded header so the binary always has fresh translations
|
||||
get_filename_component(LANG_CODE ${LANG_FILENAME} NAME_WE)
|
||||
set(LANG_HEADER ${CMAKE_SOURCE_DIR}/src/embedded/lang_${LANG_CODE}.h)
|
||||
add_custom_command(
|
||||
OUTPUT ${LANG_HEADER}
|
||||
COMMAND xxd -i "res/lang/${LANG_FILENAME}" > "src/embedded/lang_${LANG_CODE}.h"
|
||||
DEPENDS ${LANG_FILE}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Embedding lang_${LANG_CODE}.h"
|
||||
)
|
||||
list(APPEND LANG_OUTPUTS ${LANG_HEADER})
|
||||
endforeach()
|
||||
add_custom_target(copy_langs ALL DEPENDS ${LANG_OUTPUTS})
|
||||
add_dependencies(ObsidianDragon copy_langs)
|
||||
message(STATUS " Language files: ${LANG_FILES}")
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user