From 9339afcc265ba9ed7b39d919df7badd89ed9807d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 1 Oct 2019 09:56:35 +0200 Subject: [PATCH] minor fixes about translatable help files in markdown --- CMakeModules/markdown2C.cmake | 13 +++++++++++-- pcb_calculator/attenuators/bridget_tee_formula.md | 2 +- pcb_calculator/attenuators/pi_formula.md | 2 +- pcb_calculator/attenuators/splitter_formula.md | 4 ++-- pcb_calculator/attenuators/tee_formula.md | 2 +- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CMakeModules/markdown2C.cmake b/CMakeModules/markdown2C.cmake index bb898fe7a4..f1986b8e76 100644 --- a/CMakeModules/markdown2C.cmake +++ b/CMakeModules/markdown2C.cmake @@ -7,9 +7,18 @@ file( READ ${inputFile} buffer ) file( WRITE ${outputFile} "// Do not edit this file, it is autogenerated by CMake from an .md file\n" ) +# Replace each "\" char by "\\". the \ is found in .md files +# to prepend some chars that usually control chars +STRING( REGEX REPLACE "\\\\" "\\\\\\\\" linea ${buffer} ) + # Replace each EOL char by "\n" + " + EOL -STRING(REGEX REPLACE "\"" "\\\\\"" linem ${buffer}) -STRING(REGEX REPLACE "\n" "\\\\n\"\n\"" buff_m ${linem}) +STRING( REGEX REPLACE "\"" "\\\\\"" linem ${linea} ) + +# create the full string compatible "C": +# _HKI( ""\n +# to make it translatable. We use here the marker _HKI because +# the translation will be explicitely called in Kicad code +STRING( REGEX REPLACE "\n" "\\\\n\"\n\"" buff_m ${linem} ) # Write the buffer between quotes file( APPEND ${outputFile} "_HKI( \"" ${buff_m} "\" )\n" ) diff --git a/pcb_calculator/attenuators/bridget_tee_formula.md b/pcb_calculator/attenuators/bridget_tee_formula.md index 1bfda337e0..75adac69be 100644 --- a/pcb_calculator/attenuators/bridget_tee_formula.md +++ b/pcb_calculator/attenuators/bridget_tee_formula.md @@ -1,5 +1,5 @@ ### Bridged tee attenuator: -__Zin__ desired input impedance in Ω
+__Zin__ desired input impedance in Ω
__Zout__ desired output impedance
__Z0 = Zin = Zout__

diff --git a/pcb_calculator/attenuators/pi_formula.md b/pcb_calculator/attenuators/pi_formula.md index 63726834a4..28d77cdc84 100644 --- a/pcb_calculator/attenuators/pi_formula.md +++ b/pcb_calculator/attenuators/pi_formula.md @@ -1,5 +1,5 @@ ## Pi attenuator -__Zin__ desired input impedance in Ω
+__Zin__ desired input impedance in Ω
__Zout__ desired output impedance
__Zin = Zout__

diff --git a/pcb_calculator/attenuators/splitter_formula.md b/pcb_calculator/attenuators/splitter_formula.md index 4219422a16..26b0323384 100644 --- a/pcb_calculator/attenuators/splitter_formula.md +++ b/pcb_calculator/attenuators/splitter_formula.md @@ -1,7 +1,7 @@ ## Splitted attenuator ### Attenuation is 6dB -___Zin___ desired input impedance in Ω
-___Zout___ desired output impedance in Ω
+___Zin___ desired input impedance in Ω
+___Zout___ desired output impedance in Ω
___Zin = Zout___ ___R1 = R2 = R3 = Zout/3___ diff --git a/pcb_calculator/attenuators/tee_formula.md b/pcb_calculator/attenuators/tee_formula.md index 40e92f8185..320e0c68c1 100644 --- a/pcb_calculator/attenuators/tee_formula.md +++ b/pcb_calculator/attenuators/tee_formula.md @@ -1,5 +1,5 @@ ## Tee attenuator -__Zin__ desired input impedance in Ω
+__Zin__ desired input impedance in Ω
__Zout__ desired output impedance
__Zin = Zout__