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

Remove obsolete language defines and translations, single source for telemetry sensor names #3119

Merged
merged 6 commits into from
Feb 10, 2023

Conversation

mha1
Copy link
Contributor

@mha1 mha1 commented Jan 27, 2023

This is a work result of the discussion in #3082

Summary of changes:

  • removal of obsolete translations
  • all sensor names in untranslated.h (can be overridden in xx.h by #undef STR_SENSOR_<name> followed by new #define STR_SENSOR_<name>
  • naming convention for sensor names STR_SENSOR_<name> (plus editorial changes to adapt naming convention)

@mha1
Copy link
Contributor Author

mha1 commented Jan 29, 2023

@HThuren I found a few additional obsolete defines and const char declarations. Can you please run the your language test again. Thannk you very much.

@pfeerick I claimed 280 Bytes of saved flash memory for a TX16s build- To verify I built two version of TX16s firmware. One using the commit this branch is based on (d77389d), the other using the latest commit to this branch. Here's two excerpts of "arm-none-eabi-readelf -a <.elf>". All section sizes are identical apart from the first line (flash memory, virt. address starting at 0x08000000). Check out the difference in MemSiz.

Flash Bytes saved 0x1801bc-0x1800a4 = 0x118 (280 decimal). I hope my considerations are correct.

Program Headers: TX16s Firmware Base Main without branch

  Type           Offset   VirtAddr   PhysAddr   FileSiz  MemSiz   Flg Align
  LOAD           0x010000 0x08000000 0x08000000 0x1801bc 0x1801bc RWE 0x10000
  LOAD           0x1a0000 0x20000000 0x081801bc 0x00aec  0x00aec  RW  0x10000
  LOAD           0x000af0 0x20000af0 0x08180ca8 0x00000  0x0b984  RW  0x10000
  LOAD           0x00c474 0x2000c474 0x08180ca8 0x00000  0x049e8  RW  0x10000
  LOAD           0x000000 0x10000000 0x10000000 0x00000  0x0bc9c  RW  0x10000
  LOAD           0x000000 0xd0000000 0xd0000000 0x00000  0x4ff000 RW  0x10000

Program Headers: TX16s Firmware Base Main plus Branch

  Type           Offset   VirtAddr   PhysAddr   FileSiz  MemSiz   Flg Align
  LOAD           0x010000 0x08000000 0x08000000 0x1800a4 0x1800a4 RWE 0x10000
  LOAD           0x1a0000 0x20000000 0x081800a4 0x00aec  0x00aec  RW  0x10000
  LOAD           0x000af0 0x20000af0 0x08180b90 0x00000  0x0b984  RW  0x10000
  LOAD           0x00c474 0x2000c474 0x08180b90 0x00000  0x049e8  RW  0x10000
  LOAD           0x000000 0x10000000 0x10000000 0x00000  0x0bc9c  RW  0x10000
  LOAD           0x000000 0xd0000000 0xd0000000 0x00000  0x4ff000 RW  0x10000

@HThuren
Copy link
Contributor

HThuren commented Jan 29, 2023

Right, I have cloned your branch and started translation, ap. one hour to go :-)

@mha1
Copy link
Contributor Author

mha1 commented Jan 29, 2023

Awesome!

@HThuren
Copy link
Contributor

HThuren commented Jan 29, 2023

All done, not succes with CZ and IT language

@mha1
Copy link
Contributor Author

mha1 commented Jan 29, 2023

can you post the error messages please

@mha1
Copy link
Contributor Author

mha1 commented Jan 29, 2023

@HThuren Thanks for running the language build. I found the problem and it is not due to changes made here.

@philmoz Commit 475ad1f changed radio/src/gui/colorlcd/fullscreen_dialog.cpp. This section compiles with errors for CZ, FR, IT languages.

#if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_IT) || defined(TRANSLATIONS_CZ)
      t = STR_WARNING + "\n" + title;
#else
      t = title + "\n" + STR_WARNING;
#endif

error: expression must have integral or unscoped enum typeC/C++(2140)

C++ doesn't like a const char [] in thie std::string concatenation t = STR_WARNING + "\n" + title;

The fix is to convert the const char [] to a std::string. With your permission I'll change this section of code. This will build ok:

    std::string t;
    std::string warning(STR_WARNING);

    if (type == WARNING_TYPE_ALERT) {
#if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_IT) || defined(TRANSLATIONS_CZ)
      t = warning + "\n" + title;
#else
      t = title + "\n" + warning;
#endif

@mha1 mha1 marked this pull request as draft January 30, 2023 10:03
@mha1 mha1 marked this pull request as ready for review January 31, 2023 15:07
@mha1
Copy link
Contributor Author

mha1 commented Jan 31, 2023

@HThuren Would be great if you find time to run the language builds again

@HThuren
Copy link
Contributor

HThuren commented Jan 31, 2023

@HThuren Would be great if you find time to run the language builds again

Hi @mha1 , I have started the compilation now, a least one hour to go

@HThuren
Copy link
Contributor

HThuren commented Jan 31, 2023

Hi @mha1 , all good LANG in (DA EN DE CZ SE IT CN TW PL JP) all compiled

@mha1
Copy link
Contributor Author

mha1 commented Jan 31, 2023

Great, thank you very much

@pfeerick pfeerick self-assigned this Feb 3, 2023
ulfhedlund added a commit to ulfhedlund/edgetx that referenced this pull request Feb 5, 2023
pfeerick pushed a commit that referenced this pull request Feb 8, 2023
* Updated translations, error fixes etc

* Minor changes

* Minor updates

* Update for PR #2998

* Added strings for PR #2998

* Minor error fix

* Two new strings translated

* Fixed spelling mistake

* Another minor fix

* Added translations for PR #3062

* Just a few corrections

* Add files via upload

New translations added

* Changes after PR #3119 translation clean up
ulfhedlund added a commit to ulfhedlund/edgetx that referenced this pull request Feb 8, 2023
mha1 added 6 commits February 10, 2023 10:05
- all telemetry sensor name definitions follow the naming convention STR_SENSOR_<sensor>
- eliminated one redundant definition
- editorial updates to telemetry protocols code to reflect the naming convention changes
- re-introduced translations in da.h (STR_SENSOR_THROTTLE and STR_SENSOR_SPEED)
- re-introduced translation in it.h (STR_SENSOR_GPSDATETIME)
- re-introduced translation for fr.h ( STR_SENSOR_BATT)
- saved 160 Bytes of flash
saved 280 byte flash memory in total
adjusted da.h, fr.h, it.h local sensor name definitions to naming conventions STR_SENSOR_<senosr>
removed obsolete #ifdef
fixed problem in /radio/src/gui/colorlcd/fullscreen_dialog.cpp preventing builds for CZ, IT and FR languages
@mha1 mha1 force-pushed the choreCleanupTelemetryNamesDefs branch from 87b4063 to 01e7816 Compare February 10, 2023 09:10
@mha1
Copy link
Contributor Author

mha1 commented Feb 10, 2023

@pfeerick can we go ahead with this? I think the dam has broken already. #3148 (se.h) got merged two days ago. The changes made to se.h were based on changes made in this PR. Amongst those is the single source and naming change for telemetry sensors. Building main in SE configuration will fail right now because some complementary changes made in this PR are missing (eg untranslated.h). I have rebased this PR to current main. Merging this will sort out the current indefinite state of se.h too.

@pfeerick
Copy link
Member

Ah, damnit... yes, this was supposed to be merged first. Yup, and thanks for the rebase :)

@pfeerick pfeerick merged commit 2470ced into EdgeTX:main Feb 10, 2023
@pfeerick pfeerick added this to the 2.9 milestone Feb 10, 2023
@mha1
Copy link
Contributor Author

mha1 commented Feb 10, 2023

@pfeerick No problemo, you got a lot on your plate. I really appreciate your expertise and you putting in lots of hours.

philmoz pushed a commit to philmoz/edgetx that referenced this pull request Feb 13, 2023
* main: (30 commits)
  feat(cpn): Radiomaster Boxer support (EdgeTX#2910)
  chore: Move __global_locale to FLASH (frees some RAM!) (EdgeTX#3169)
  chore: Remove obsolete language defines, single source for telemetry sensor names (EdgeTX#3119)
  feat(lua): Port of NodeMCU Lua53 read-only tables (EdgeTX#2994)
  chore: New module/serial API (EdgeTX#3055)
  chore: Updated SE translations 🇸🇪 (EdgeTX#3148)
  Update README.md
  fix(color): Duplicate selected theme, update color list (EdgeTX#3122)
  fix: Regenerate yaml, carryTrim => trimSource cleanup (EdgeTX#3121)
  chore(color): LVGLify custom mixer scripts page (EdgeTX#3071)
  fix(translation): String casting for CZ/IT/FR Fixes EdgeTX#3145
  fix(cpn): Save "set main view" number for special/global function (EdgeTX#3132)
  chore(color): LVGLify statistics and debug screens (EdgeTX#3072)
  chore(color): LVGLify and enhance model -> telemetry page (EdgeTX#3070)
  chore: Updates to Danish translations 🇩🇰 (EdgeTX#3128)
  chore: CN/TW translations for theme save and delete strings (EdgeTX#3129)
  chore: fix STM32 HAL headers
  fix(color): Overlap in logical switch monitor footer (EdgeTX#3137)
  fix(doc): LUA doc link to units.md
  feat(color): Change global variables layout to better match other pages (EdgeTX#3116)
  ...
@mha1 mha1 deleted the choreCleanupTelemetryNamesDefs branch July 6, 2023 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants